﻿:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --sidebar: #0b1120;
    --sidebar-soft: #121b31;
    --text: #172033;
    --muted: #667085;
    --line: #dfe5ee;
    --line-strong: #cfd8e6;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eaf1ff;
    --success: #17845f;
    --success-soft: #e8f7f1;
    --warning: #b76e00;
    --warning-soft: #fff5d8;
    --danger: #c4314b;
    --danger-soft: #fff0f3;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 12px 32px rgba(26, 38, 65, .09);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --sidebar-width: 268px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-width); display: flex; flex-direction: column;
    padding: 22px 16px 18px; color: #d5deed; background:
        radial-gradient(circle at 22% 0%, rgba(49, 101, 218, .24), transparent 34%), var(--sidebar);
    border-right: 1px solid rgba(255, 255, 255, .07);
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 5px 8px; color: #fff; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #4d8dff, #1e54cf); box-shadow: 0 8px 22px rgba(37, 99, 235, .35); font-weight: 800; }
.brand strong, .operator strong { display: block; font-size: .94rem; letter-spacing: .02em; }
.brand small, .operator small { display: block; color: #8fa0ba; font-size: .75rem; }
.main-nav { flex: 1; min-height: 0; margin-top: 28px; padding-right: 2px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #334764 transparent; }
.nav-label { margin: 24px 12px 8px; color: #6f829f; font-size: .72rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.main-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 3px 0; padding: 10px 12px; border-radius: 10px; color: #9fb0c8; text-decoration: none; font-size: .9rem; font-weight: 580; transition: color .16s, background .16s, transform .16s; }
.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); transform: translateX(2px); }
.main-nav a.is-active { color: #fff; background: linear-gradient(90deg, rgba(48, 112, 242, .25), rgba(48, 112, 242, .10)); box-shadow: inset 3px 0 #4f8cff; }
.main-nav svg, .logout-button svg { width: 20px; height: 20px; flex: none; }
.sidebar-footer { padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .09); }
.operator { display: flex; align-items: center; gap: 10px; padding: 9px 8px 13px; }
.operator-vertical {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.operator-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: center;
}
.operator-avatar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    height: auto;
    background: transparent;
}

    .operator-avatar img {
        width: 130px;
        height: auto;
        object-fit: contain;
    }
.logout-button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; color: #91a3bc; text-decoration: none; font-size: .86rem; }
.logout-button:hover { color: #fff; background: rgba(255, 255, 255, .07); }

.app-content { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; min-height: 68px; padding: 0 36px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-title { display: flex; align-items: center; gap: 9px; color: #536078; font-size: .86rem; font-weight: 650; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #23a879; box-shadow: 0 0 0 4px #e2f7ef; }
.system-clock { margin-left: auto; color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.icon-button { display: none; width: 40px; height: 40px; padding: 9px; border: 0; border-radius: 9px; background: transparent; color: #344054; cursor: pointer; }
.icon-button:hover { background: #eef2f7; }
.icon-button svg { width: 22px; height: 22px; }
.page-content { width: min(100%, 1680px); margin: 0 auto; padding: 34px 36px 52px; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--primary); font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.page-header h1 { margin: 0; color: #111827; font-size: clamp(1.65rem, 2.5vw, 2.15rem); line-height: 1.18; letter-spacing: -.035em; }
.page-subtitle { max-width: 720px; margin: 8px 0 0; color: var(--muted); font-size: .96rem; }
.header-badge { display: flex; align-items: center; gap: 8px; flex: none; padding: 9px 12px; border: 1px solid #cfe4dc; border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: .8rem; font-weight: 700; }
.header-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.content-grid.two-columns { grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); align-items: start; }
.stack { display: grid; gap: 20px; }
.section-gap { margin-top: 20px; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 21px 24px 16px; }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.card-title { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.card-description { margin: 5px 0 0; color: var(--muted); font-size: .86rem; }
.card-body { padding: 0 24px 24px; }
.card-divider { border-top: 1px solid var(--line); }

.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: end; }
.form-gap { margin-top: 16px; }
.field { grid-column: span 4; min-width: 0; }
.field.span-3 { grid-column: span 3; }
.field.span-5 { grid-column: span 5; }
.field.span-6 { grid-column: span 6; }
.field.span-8 { grid-column: span 8; }
.field.span-12 { grid-column: 1 / -1; }
.field label, .field-label { display: block; margin-bottom: 7px; color: #344054; font-size: .82rem; font-weight: 700; }
.input, input[type="text"], input[type="password"], input[type="file"], select, textarea {
    width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--text); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type="file"] { padding: 7px 8px; color: var(--muted); background: var(--surface-subtle); }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 6px 10px; border: 0; border-radius: 6px; color: #24457f; background: #e6efff; font-weight: 700; cursor: pointer; }
input:focus, select:focus, textarea:focus { border-color: #6d9cff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
input[readonly] { color: #596579; background: #f5f7fa; }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: .76rem; }
.path-value { display: inline-flex; max-width: 100%; padding: 6px 9px; border: 1px solid #d8e1ef; border-radius: 7px; color: #475467; background: #f5f8fc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .77rem; overflow-wrap: anywhere; }
.checkbox-control { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; color: #344054; font-size: .86rem; font-weight: 650; }
.checkbox-control input, .data-grid input[type="checkbox"] { width: 17px; height: 17px; min-height: auto; accent-color: var(--primary); cursor: pointer; }
.checkbox-control label { margin: 0; cursor: pointer; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn, input[type="submit"].btn, a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: .84rem; font-weight: 750; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 4px 12px rgba(37, 99, 235, .18); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { color: #344054; background: #fff; border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-subtle); }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: #ffd2da; }
.btn-danger:hover { background: #ffe4e9; }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbfcfe; }
.search-field { position: relative; width: min(340px, 100%); }
.search-field input { min-height: 38px; padding-left: 36px; background: #fff; }
.search-field svg { position: absolute; left: 11px; top: 10px; width: 18px; height: 18px; color: #7b8799; }
.record-count { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.table-scroll { width: 100%; overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.terminal-list-scroll { max-height: max(360px, calc(100vh - 250px)); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.terminal-list-scroll .data-grid th { position: sticky; top: 0; z-index: 6; box-shadow: 0 1px 0 var(--line-strong), 0 5px 12px rgba(15, 23, 42, .06); }
.data-grid { width: 100% !important; min-width: 820px; border: 0 !important; border-collapse: separate; border-spacing: 0; background: #fff; color: var(--text) !important; font-size: .84rem; }
.data-grid th { padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line-strong); color: #536078; background: #f6f8fb !important; font-size: .72rem; font-weight: 800 !important; letter-spacing: .055em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-grid td { padding: 12px 14px; border: 0; border-bottom: 1px solid #e9edf3; color: #344054; vertical-align: middle; }
.data-grid tr:last-child td { border-bottom: 0; }
.data-grid tr:hover td { background: #f8fbff !important; }
.data-grid tr.is-selected td { background: #edf4ff !important; }
.data-grid a { display: inline-flex; margin: 2px 6px 2px 0; padding: 5px 8px; border: 1px solid #d7dfeb; border-radius: 6px; color: #334155; background: #fff; font-size: .75rem; font-weight: 700; text-decoration: none; }
.data-grid a:hover { color: var(--primary); border-color: #a9c5ff; background: #f2f6ff; }
.data-grid a[href*="Delete"] { color: var(--danger); border-color: #f3c8d0; background: var(--danger-soft); }
.version-current { background: var(--warning-soft) !important; color: #744900 !important; font-weight: 700; }
.version-match { background: var(--success-soft) !important; color: #126b4e !important; font-weight: 700; }

.bulk-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--line); background: #f8faff; }
.bulk-bar .field { flex: 1 1 190px; grid-column: auto; }
.bulk-bar .checkbox-control { flex: 0 0 auto; }
.bulk-bar .actions { margin-left: auto; }
.empty-note { padding: 28px; color: var(--muted); text-align: center; }
.validation-error { display: block; margin-top: 6px; color: var(--danger); font-size: .78rem; font-weight: 650; }

.upload-progress { margin-top: 4px; padding: 14px 15px; border: 1px solid #cfdbef; border-radius: 11px; background: #f8faff; }
.upload-progress-heading, .upload-progress-details { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.upload-progress-heading { margin-bottom: 10px; color: #344054; font-size: .82rem; font-weight: 700; }
.upload-progress-heading strong { color: var(--primary); font-size: .88rem; font-variant-numeric: tabular-nums; }
.upload-progress-track { position: relative; height: 10px; overflow: hidden; border-radius: 999px; background: #e4eaf4; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .08); }
.upload-progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #4f8cff); box-shadow: 0 0 12px rgba(37, 99, 235, .28); transition: width .2s ease; }
.upload-progress-details { margin-top: 9px; color: var(--muted); font-size: .76rem; }
.upload-progress-details span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress-details span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.upload-progress.is-complete { border-color: #b9e1d2; background: #f2fbf7; }
.upload-progress.is-complete .upload-progress-heading strong { color: var(--success); }
.upload-progress.is-complete .upload-progress-track > span { background: linear-gradient(90deg, #16845f, #28b383); }
.upload-progress.is-error { border-color: #f0c5ce; background: #fff7f8; }
.upload-progress.is-error .upload-progress-heading, .upload-progress.is-error .upload-progress-heading strong { color: var(--danger); }
.upload-progress.is-error .upload-progress-track > span { background: linear-gradient(90deg, #c82b49, #e55b72); }
.upload-error { margin-top: 0; padding: 10px 12px; border: 1px solid #f0c5ce; border-radius: 9px; background: #fff7f8; }
.btn:disabled, input[type="submit"].btn:disabled { cursor: wait; opacity: .62; transform: none; }

.readonly-banner { display: flex; align-items: center; gap: 11px; margin: 0 0 22px; padding: 12px 15px; border: 1px solid #cddbf6; border-radius: 11px; color: #24457f; background: #f2f6ff; font-size: .86rem; }
.readonly-banner svg { width: 20px; height: 20px; flex: none; color: var(--primary); }
.readonly-banner strong { color: #17366f; }

.monitoring-grid { min-width: 720px; }
.monitoring-grid th:first-child, .monitoring-grid td:first-child { width: 62px; text-align: center; }
.monitoring-grid th.device-column-header { width: 78px; min-width: 68px; max-width: 92px; padding-inline: 7px; text-align: center; white-space: normal; overflow-wrap: anywhere; }
.monitoring-grid td.device-status-cell { width: 78px; min-width: 68px; padding: 0 !important; text-align: center; transition: filter .15s; }
.monitoring-grid td.device-status-cell.status-ok { background: #e4f7ef !important; }
.monitoring-grid td.device-status-cell.status-warning { background: #fff2c9 !important; }
.monitoring-grid td.device-status-cell.status-error { background: #ffe1e6 !important; }
.monitoring-grid td.device-status-cell.status-unknown { background: #f1f4f8 !important; }
.monitoring-grid tr:hover td.device-status-cell { filter: brightness(.975); }
.terminal-grid-device-icon { display: grid; width: 100%; min-height: 48px; place-items: center; color: #344054; cursor: help; }
.terminal-grid-device-icon svg { width: 22px; height: 22px; }
.terminal-grid-device-empty { display: grid; min-height: 48px; place-items: center; color: #98a2b3; cursor: help; }
.info-action { align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0 !important; padding: 0 !important; color: var(--primary) !important; border-color: #bfd2fa !important; background: #f4f7ff !important; }
.info-action svg { width: 16px; height: 16px; }
.data-grid th a { margin: 0; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.data-grid th a:hover { color: var(--primary); border-color: transparent; background: transparent; }

body.modal-open { overflow: hidden; }
.modal-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 28px; background: rgba(6, 13, 28, .64); backdrop-filter: blur(4px); animation: modal-fade .16s ease-out; }
.modal-panel { display: flex; flex-direction: column; width: min(1120px, 100%); max-height: min(880px, calc(100vh - 56px)); overflow: hidden; border: 1px solid rgba(255,255,255,.7); border-radius: 20px; background: #fff; box-shadow: 0 30px 90px rgba(2, 8, 23, .34); animation: modal-rise .2s ease-out; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #f8faff, #fff); }
.modal-header h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.025em; }
.modal-close { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; color: #526079; background: #fff; text-decoration: none; transition: color .15s, background .15s, transform .15s; }
.modal-close:hover { color: #111827; background: #f3f6fa; transform: translateY(-1px); }
.modal-close svg { width: 20px; height: 20px; }
.modal-body { padding: 24px 26px 30px; overflow: auto; }
.terminal-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.meta-card { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-subtle); }
.meta-card span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .71rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.meta-card strong { display: block; overflow: hidden; color: #1d2939; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.xml-heading { display: flex; justify-content: space-between; gap: 16px; margin: 0 0 13px; }
.xml-heading h3 { margin: 0; font-size: 1rem; }
.xml-heading p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.xml-tree { display: grid; gap: 12px; }
.xml-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.xml-group { grid-column: 1 / -1; overflow: hidden; border: 1px solid #dce4f0; border-radius: 12px; background: #fff; }
.xml-group .xml-group { margin: 10px; }
.xml-group-title { margin: 0; padding: 10px 13px; border-bottom: 1px solid var(--line); color: #344054; background: #f6f8fb; font-size: .77rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.xml-item { min-width: 0; padding: 11px 13px; background: #fff; }
.xml-key { display: block; margin-bottom: 3px; color: #667085; font-size: .72rem; font-weight: 700; }
.xml-value { display: block; color: #1d2939; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .79rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.xml-empty { padding: 28px 18px; border: 1px dashed #cfd8e6; border-radius: 11px; color: var(--muted); background: #fafbfd; text-align: center; }

.terminal-report { display: grid; gap: 18px; }
.status-section { overflow: hidden; border: 1px solid #dce4f0; border-radius: 14px; background: #fff; box-shadow: 0 2px 7px rgba(24, 39, 75, .035); }
.status-section-header { display: flex; align-items: center; gap: 12px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, #f7f9fd, #fff); }
.status-section-header h3 { margin: 0; color: #172033; font-size: .98rem; }
.status-section-header p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }
.status-section-icon, .device-icon, .health-icon, .identity-icon { display: grid; flex: none; place-items: center; color: var(--primary); background: #edf3ff; }
.status-section-icon { width: 38px; height: 38px; border-radius: 10px; }
.status-section-icon svg { width: 20px; height: 20px; }
.status-section-body { padding: 16px; }

.device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.device-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.device-card-header { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.device-card.device-status-ok { border-color: #abdcca; background: #effaf5; }
.device-card.device-status-ok .device-card-header { border-color: #c2e8da; background: #e7f7f0; }
.device-card.device-status-warning { border-color: #ead28e; background: #fff9e9; }
.device-card.device-status-warning .device-card-header { border-color: #eedba6; background: #fff4d7; }
.device-card.device-status-error { border-color: #efb7c1; background: #fff1f3; }
.device-card.device-status-error .device-card-header { border-color: #f0c4cc; background: #ffe8ec; }
.device-card.device-status-unknown { border-color: #d7dee9; background: #f7f9fc; }
.device-card.device-status-unknown .device-card-header { background: #f2f5f9; }
.device-icon { width: 40px; height: 40px; border-radius: 11px; }
.device-icon svg { width: 21px; height: 21px; }
.device-icon.icon-printer { color: #6f42c1; background: #f3edff; }
.device-icon.icon-cash { color: #147959; background: #e9f8f2; }
.device-icon.icon-card { color: #1f66d1; background: #eaf2ff; }
.device-icon.icon-display { color: #b45d08; background: #fff3e5; }
.device-icon.icon-coffee { color: #8a4b22; background: #f8eee7; }
.device-icon.icon-scanner { color: #a52f48; background: #fff0f3; }
.device-icon.icon-network { color: #087987; background: #e7f7fa; }
.device-title { min-width: 0; }
.device-title h4 { margin: 0 0 3px; overflow: hidden; color: #1d2939; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.device-type { display: inline-flex; max-width: 100%; color: #667085; font-size: .72rem; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; }
.device-status-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; border: 1px solid #d7dee9; border-radius: 999px; color: #536078; background: rgba(255,255,255,.7); font-size: .68rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.device-status-ok .device-status-badge { color: #126247; border-color: #a8dac7; background: #fff; }
.device-status-warning .device-status-badge { color: #805400; border-color: #dfc36e; background: #fffdf7; }
.device-status-error .device-status-badge { color: #9a2037; border-color: #e8a9b4; background: #fff; }
.device-properties { display: grid; padding: 8px 14px 11px; }
.device-property { display: grid; grid-template-columns: minmax(90px, auto) 12px minmax(0, 1fr); gap: 5px; padding: 6px 0; border-bottom: 1px dashed #e2e8f0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .79rem; }
.device-property:last-child { border-bottom: 0; }
.device-property-key { color: #536078; overflow-wrap: anywhere; }
.device-property-equals { color: #98a2b3; text-align: center; }
.device-property-value { color: #172033; font-weight: 700; overflow-wrap: anywhere; white-space: pre-wrap; }
.device-property-empty { padding: 9px 0 5px; color: var(--muted); font-size: .8rem; }

.monitor-table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.monitor-table { width: 100%; min-width: 580px; border-collapse: collapse; font-size: .82rem; }
.monitor-table th { padding: 10px 12px; border-bottom: 1px solid var(--line-strong); color: #536078; background: #f5f7fb; font-size: .71rem; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.monitor-table td { padding: 11px 12px; border-bottom: 1px solid #e9edf3; color: #344054; overflow-wrap: anywhere; }
.monitor-table tbody tr:last-child td { border-bottom: 0; }
.monitor-table tbody tr:hover td { background: #f8fbff; }

.health-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.health-card { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.health-card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.health-card-title h4 { margin: 0; font-size: .86rem; }
.health-icon { width: 30px; height: 30px; border-radius: 8px; }
.health-icon svg { width: 17px; height: 17px; }
.health-values, .cashout-values { display: grid; gap: 7px; }
.label-value { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed #e1e7f0; }
.label-value:last-child { border-bottom: 0; }
.label-value span { color: #667085; font-size: .76rem; }
.label-value strong { color: #1d2939; font-size: .82rem; text-align: right; overflow-wrap: anywhere; }
.health-storage { margin-top: 15px; }
.health-storage > h4 { margin: 0 0 9px; color: #344054; font-size: .86rem; }

.totals-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(145deg, #fbfcff, #f5f8ff); }
.metric-card h4 { margin: 0 0 12px; color: #344054; font-size: .84rem; }
.metric-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.metric-value { min-width: 0; padding: 10px; border: 1px solid #e0e8f6; border-radius: 9px; background: #fff; }
.metric-value strong { display: block; overflow: hidden; color: #17366f; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.metric-value span { display: block; margin-top: 2px; color: var(--muted); font-size: .72rem; }

.cashout-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cashout-values .label-value { padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.identity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.identity-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.identity-icon { width: 39px; height: 39px; border-radius: 10px; }
.identity-icon svg { width: 20px; height: 20px; }
.identity-card > div { min-width: 0; }
.identity-card span { display: block; color: var(--muted); font-size: .73rem; }
.identity-card strong { display: block; overflow: hidden; margin-top: 2px; color: #172033; font-size: .94rem; text-overflow: ellipsis; white-space: nowrap; }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background:
    radial-gradient(circle at 18% 18%, rgba(57, 112, 230, .3), transparent 27%),
    radial-gradient(circle at 86% 84%, rgba(26, 138, 111, .19), transparent 28%), #081020; }
.login-shell { width: min(100%, 430px); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; color: #fff; }
.login-brand .brand-mark { width: 48px; height: 48px; }
.login-brand strong { display: block; font-size: 1.15rem; }
.login-brand small { color: #94a4bb; }
.login-card { padding: 34px; border: 1px solid rgba(255,255,255,.1); border-radius: 20px; background: rgba(255,255,255,.97); box-shadow: 0 30px 70px rgba(0,0,0,.28); }
.login-card h1 { margin: 0; font-size: 1.55rem; letter-spacing: -.025em; }
.login-card > p { margin: 8px 0 25px; color: var(--muted); font-size: .9rem; }
.login-card table { width: 100%; }
.login-card td { display: block; width: 100%; padding: 0; }
.login-card .login-row { display: block; margin-bottom: 16px; }
.login-card .btn { width: 100%; margin-top: 7px; }
.login-error { display: block; margin: 0 0 14px; padding: 9px 11px; border-radius: 8px; color: #9f1f37; background: var(--danger-soft); font-size: .82rem; }
.login-error:empty { display: none; }
.login-footer { margin: 18px 0 0; color: #718096; font-size: .76rem; text-align: center; }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast { padding: 13px 15px; border: 1px solid #d8e2f0; border-radius: 11px; color: #253047; background: #fff; box-shadow: var(--shadow-md); font-size: .86rem; animation: toast-in .22s ease-out; }
.toast.is-error { color: #971d34; border-color: #f3c3cd; background: #fff7f8; }
.toast.is-success { color: #126247; border-color: #bfe4d5; background: #f4fcf9; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1120px) {
    .content-grid.two-columns { grid-template-columns: 1fr; }
    .field, .field.span-3, .field.span-5 { grid-column: span 6; }
}
@media (max-width: 820px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(2, 8, 23, .24); }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(3, 8, 19, .48); }
    .app-content { margin-left: 0; }
    .topbar { padding: 0 20px; }
    .icon-button { display: grid; place-items: center; margin-right: 10px; }
    .page-content { padding: 26px 20px 42px; }
    .page-header { flex-direction: column; }
    .system-clock { display: none; }
    .terminal-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .page-content { padding-inline: 14px; }
    .card-header, .card-body { padding-left: 17px; padding-right: 17px; }
    .field, .field.span-3, .field.span-5, .field.span-6, .field.span-8 { grid-column: 1 / -1; }
    .table-toolbar { align-items: stretch; flex-direction: column; }
    .search-field { width: 100%; }
    .bulk-bar { align-items: stretch; flex-direction: column; }
    .bulk-bar .field { flex-basis: auto; width: 100%; }
    .bulk-bar .actions { margin-left: 0; }
    .bulk-bar .btn { width: 100%; }
    .login-card { padding: 26px 22px; }
    .modal-overlay { padding: 10px; }
    .modal-panel { max-height: calc(100vh - 20px); border-radius: 15px; }
    .modal-header, .modal-body { padding-left: 17px; padding-right: 17px; }
    .terminal-meta, .xml-detail-grid { grid-template-columns: 1fr; }
    .device-grid, .health-grid, .totals-grid, .cashout-values, .identity-grid { grid-template-columns: 1fr; }
    .status-section-body { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Язык сохраняется на этом браузере для всех страниц, включая вход. */
.language-picker{display:inline-flex;align-items:center;gap:9px;font-size:12px;color:#64748b;white-space:nowrap;margin-left:auto}.language-picker select{min-width:76px;padding:8px 28px 8px 12px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#0f172a;font:inherit;font-weight:700;cursor:pointer}.language-picker select:focus-visible{outline:3px solid #93c5fd;outline-offset:2px}.topbar .language-picker{margin-left:18px;margin-right:0;flex-shrink:0}.login-shell>.language-picker{display:flex;justify-content:flex-end;color:#cbd5e1;margin:0 0 18px}.login-shell>.language-picker select{background:#fff}.topbar{flex-wrap:wrap}.topbar .system-clock{white-space:nowrap}.topbar-title{margin-right:auto}.topbar .system-clock{margin-left:18px}@media(max-width:600px){.topbar .language-picker{margin-right:0}.topbar .language-picker>span{display:none}.topbar .system-clock{display:none}}
