/* Compact Intera UI. Orange denotes actions; state colours retain their meaning. */
:root {
  color-scheme:light;
  --shell-bg:#eeede9; --shell-sidebar:#e7e6e0; --shell-card:#ffffff;
  --shell-border:#dcdcd4; --shell-text:#20211e; --shell-muted:#6e7068;
  --shell-accent:#e95416; --shell-ok:#12866d; --shell-warn:#916815; --shell-danger:#c33c40;
  --accent-ink:#bd3d0c; --action-text:#111110;
  --bg-0:var(--shell-bg); --bg-1:var(--shell-bg); --card:var(--shell-card); --card-2:#f2f2ec;
  --card-glass:var(--shell-card); --border:var(--shell-border); --border-strong:#aaa99e;
  --text:var(--shell-text); --muted:var(--shell-muted); --green:var(--shell-ok);
  --yellow:var(--shell-warn); --red:var(--shell-danger); --blue:#28649a;
  --orange-soft:#fff0e7; --ok-soft:#eaf5f0; --warn-soft:#faf1d9; --danger-soft:#fbecee;
  --surface-inset:#f5f4ef; --surface-hover:#e1e0d8; --selected-bg:#22241f; --selected-text:#fff;
  --radius:17px; --radius-sm:10px; --shadow:0 5px 16px #34332a06;
  --bg:var(--shell-bg); --bg-card:var(--card); --accent:var(--shell-accent); --accent-hover:#d04b12;
  --danger:var(--red); --ok:var(--green);
}
:root[data-theme="dark"] {
  color-scheme:dark;
  --shell-bg:#111110; --shell-sidebar:#161614; --shell-card:#1e1f1b;
  --shell-border:#353630; --shell-text:#f2f1e8; --shell-muted:#a8a99e;
  --shell-accent:#ff783b; --shell-ok:#6fc5a1; --shell-warn:#e9c567; --shell-danger:#ee8d8a;
  --accent-ink:#ff935f;
  --card-2:#292a25; --border-strong:#68695b; --blue:#8eb4dc;
  --orange-soft:#392820; --ok-soft:#23332b; --warn-soft:#383222; --danger-soft:#3b2827;
  --surface-inset:#282923; --surface-hover:#2d2e27; --selected-bg:#f2f1e8; --selected-text:#20211e;
  --shadow:0 6px 18px #00000012;
}
html,body,body.shell-body { background:var(--shell-bg); color:var(--text); }
body { -webkit-font-smoothing:antialiased; }
button,input,select,textarea { font:inherit; }
[hidden] { display:none !important; }
:focus-visible { outline:2px solid var(--shell-accent); outline-offset:3px; }
.shell-layout { grid-template-columns:210px minmax(0,1fr); overflow:clip; }
.shell-sidebar { padding:24px 14px 18px; border-color:var(--border); gap:26px; background:var(--shell-sidebar); }
.shell-brand { display:flex; flex-direction:column; font-size:30px; font-weight:800; letter-spacing:-1.5px; padding:0 12px; color:var(--shell-accent); }
.shell-brand span { font-size:9px; font-weight:600; text-transform:uppercase; letter-spacing:2px; color:var(--muted); margin-top:4px; }
.shell-nav { display:flex; flex-direction:column; gap:4px; }
.shell-nav a { display:flex; align-items:center; gap:12px; min-height:42px; padding:10px 12px; border:1px solid transparent; border-radius:9px; color:var(--muted); font-size:13px; font-weight:550; }
.shell-nav a:hover { background:var(--surface-hover); color:var(--text); }
.shell-nav a.active { background:var(--orange-soft); color:var(--accent-ink); border-color:transparent; box-shadow:none; }
.shell-nav-index { font-size:10px; opacity:.65; font-variant-numeric:tabular-nums; }
.shell-sidebar-footer { margin-top:auto; border-color:var(--border); }
.shell-user { line-height:1.7; font-size:11px; }
.shell-user strong { color:var(--text); font-size:12px; overflow-wrap:anywhere; }
.shell-main { padding:28px; min-width:0; }
.shell-main--monitor { padding:0; }
.shell-main--monitor .app,.app { max-width:1360px; padding:22px 30px 40px; margin:0 auto; }
.app-header { display:flex; justify-content:space-between; gap:12px; padding:0 0 20px; margin:0; position:relative; top:0; background:none; backdrop-filter:none; }
.workspace-title { flex:1; }
.app-header h1 { text-align:left; margin:0; font-size:25px; font-weight:700; letter-spacing:-.6px; }
.header-actions { gap:7px; }
.icon-btn { width:36px; height:36px; border-radius:10px; background:var(--card); color:var(--text); box-shadow:none; flex-shrink:0; }
.icon-btn svg { width:18px; height:18px; }
.badge { border:2px solid var(--bg-0); }
.theme-toggle { height:36px; padding:0 11px; border:1px solid var(--border); border-radius:9px; color:var(--text); background:var(--card); font-size:11px; font-weight:600; cursor:pointer; flex-shrink:0; }
.theme-toggle:hover { border-color:var(--shell-accent); }
#menuBtn,#logoutTopBtn { display:none; }
.shell-menu-toggle { color:var(--text); background:var(--card); border-color:var(--border); }
@media (min-width:901px) { .shell-menu-toggle { display:none; } }
.log-date { margin-bottom:10px; width:100%; padding:10px; }
.tx-summary__amount { color:var(--shell-accent); }
.tx-item__amount { color:var(--accent-ink); }
.monitor-toolbar { background:var(--card); border:1px solid var(--border); border-radius:15px; padding:14px; display:flex; flex-wrap:wrap; align-items:flex-start; gap:12px; margin-bottom:12px; }
.search-row { flex:1 1 240px; margin:0; }
.search-field { height:40px; background:var(--surface-inset); border:1px solid transparent; border-radius:9px; color:var(--muted); }
.search-field input { font-size:13px; color:var(--text); }
.search-field input::placeholder { color:var(--muted); }
.search-field:focus-within { border-color:var(--shell-accent); box-shadow:none; }
.advanced-filters { flex:0 0 auto; }
.advanced-filters summary { height:40px; padding:11px 13px; cursor:pointer; font-size:12px; font-weight:600; color:var(--muted); border:1px solid var(--border); border-radius:9px; }
.advanced-filters[open] { flex-basis:100%; order:3; }
.advanced-filters[open] summary { width:fit-content; margin-bottom:10px; }
.monitor-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; margin:0; }
.shell-select,.shell-input,.shell-textarea,.monitor-filter { background:var(--surface-inset); border:1px solid var(--border); border-radius:8px; color:var(--text); min-height:38px; font-size:12px; }
.filter-tabs { width:100%; order:2; gap:7px; padding:0; margin:0; border:0; flex-wrap:wrap; }
.filter-tab { border:1px solid var(--border); border-radius:9px; background:var(--card); color:var(--muted); font-size:12px; padding:8px 12px; min-height:36px; }
.filter-tab--active,.filter-tab--ok.filter-tab--active,.filter-tab--warn.filter-tab--active { background:var(--selected-bg); border-color:var(--selected-bg); color:var(--selected-text); }
.filter-tab__count { border-radius:5px; padding:1px 5px; margin-left:5px; background:color-mix(in srgb,currentColor 9%,transparent); font-size:11px; }
.list-result { display:flex; justify-content:flex-end; margin:0 2px 10px; font-size:10px; color:var(--muted); }
.machine-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.machine-card { background:var(--card); border-radius:17px; border-color:var(--border); box-shadow:var(--shadow); animation-duration:.2s; }
.machine-card:hover { border-color:var(--shell-accent); transform:translateY(-2px); }
.machine-card__glow { display:none; }
.machine-card__inner { padding:16px; }
.machine-card__top { gap:6px; flex-wrap:wrap; margin-bottom:18px; }
.status-chip { font-size:10px; letter-spacing:0; font-weight:600; padding:4px 7px; border-radius:6px; border:0; }
.status-chip--online { color:var(--green); background:var(--ok-soft); }
.status-chip--offline { color:var(--red); background:var(--danger-soft); }
.status-chip--install { color:var(--yellow); background:var(--warn-soft); }
.mini-chip { font-size:10px; color:var(--muted); background:transparent; padding:3px 0; margin-left:auto; }
.machine-card__alerts { margin:0; }
.health-alert { width:20px; height:20px; font-size:11px; }
.machine-card__title { font-size:20px; font-weight:700; text-transform:none; letter-spacing:-.65px; margin:0 0 3px; padding:0; line-height:1.2; min-height:48px; overflow-wrap:anywhere; }
.machine-card__subtitle { font-size:10px; margin:7px 0 18px; color:var(--muted); line-height:1.4; }
.machine-card__metrics { display:flex; flex-direction:column; gap:6px; }
.metric-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:5px 8px; position:relative; min-width:0; overflow:hidden; background:var(--surface-inset) !important; border:1px solid transparent; border-radius:9px; text-shadow:none; color:var(--text); }
.metric-row::before { content:''; position:absolute; inset:0; background:linear-gradient(90deg,#e14a46 0%,#e7b343 50%,#21a778 100%); opacity:.14; clip-path:inset(0 calc(100% - var(--metric-progress,0%)) 0 0); pointer-events:none; }
.metric-row__label,.metric-row__value { position:relative; z-index:1; }
.metric-row__track { position:relative; grid-column:1/-1; width:100%; height:6px; border-radius:4px; background:var(--border); }
.metric-row__fill { position:absolute; inset:0; border-radius:4px; background:linear-gradient(90deg,#e14a46 0%,#e7b343 50%,#21a778 100%); clip-path:inset(0 calc(100% - var(--metric-progress,0%)) 0 0); }
.metric-row__marker { position:absolute; top:-1px; left:clamp(3px,var(--metric-progress,0%),calc(100% - 3px)); width:8px; height:8px; border-radius:50%; transform:translateX(-50%); background:var(--metric-color); box-shadow:0 0 0 1px var(--surface-inset); }
.metric-row--unknown .metric-row__marker,.metric-row--unknown::before { display:none; }
:root[data-theme="dark"] .metric-row::before { opacity:.2; }
.machine-card .metric-row { margin:0; padding:8px 10px; min-height:37px; }
.metric-row__label { color:var(--muted); font-size:9px; letter-spacing:.5px; font-weight:600; opacity:1; }
.metric-row__value { font-family:'Bahnschrift','Arial Narrow',system-ui,sans-serif; font-size:20px; font-weight:650; letter-spacing:-.5px; font-variant-numeric:tabular-nums; }
.machine-card--offline .metric-row__value { color:var(--muted); }
.machine-card--offline .metric-row__track { opacity:.65; }
.machine-card__hint { color:var(--muted); font-size:9px; margin:9px 0 0; }
.machine-card__hint--warn { color:var(--yellow); }
.empty-state { grid-column:1/-1; padding:35px 20px; background:var(--card); border:1px dashed var(--border); border-radius:14px; color:var(--muted); line-height:1.7; }
.skeleton-card { background:var(--surface-inset); border-color:var(--border); }
.detail-header { background:var(--bg-0); margin:0 0 18px; padding:0; position:relative; top:0; }
.detail-header__title { font-size:21px; text-transform:none; letter-spacing:-.5px; }
.detail-tabs { border-bottom:1px solid var(--border); padding-bottom:12px; margin-bottom:18px; }
.detail-tab { color:var(--muted); font-size:11px; letter-spacing:1.1px; }
.detail-tab--active { background:var(--selected-bg); color:var(--selected-text); border-radius:9px; }
.hero-card { background:var(--card); padding:22px; border-color:var(--border); }
.hero-card__title { text-transform:none; letter-spacing:-1px; font-size:32px; color:var(--text); }
.hero-card--offline { background:var(--card); border-color:var(--red); }
.hero-card--install { background:var(--card); border-color:var(--yellow); }
.hero-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.hero-metrics .metric-row { gap:10px; padding:15px; margin:0; }
.hero-metrics .metric-row__value { font-size:30px; color:var(--text); }
.hero-meta,.hero-meta__btn { color:var(--muted); }
.action-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.action-card { aspect-ratio:auto; min-height:100px; max-height:none; width:100%; background:var(--card); color:var(--text); border-color:var(--border); backdrop-filter:none; }
.action-card:hover { background:var(--orange-soft); border-color:var(--shell-accent); }
.action-card svg { width:26px; height:26px; color:var(--shell-accent); }
.action-card span { font-size:10px; letter-spacing:.4px; }
.glass-panel,.section-card,.shell-card { background:var(--card); border:1px solid var(--border); border-radius:15px; box-shadow:var(--shadow); color:var(--text); }
.info-list,.info-list strong,.events-list,.tx-list,.tx-item,.tx-amount { color:var(--text); }
.glass-panel h3 { color:var(--text); font-weight:650; }
.date-range input,.field-label input { background:var(--surface-inset); color:var(--text); border-color:var(--border); }
.shell-header h1 { font-size:27px; letter-spacing:-.7px; font-weight:700; }
.shell-table th { color:var(--muted); font-size:11px; font-weight:500; background:var(--surface-inset); }
.shell-table td { font-size:13px; }
.shell-table tbody tr:hover { background:var(--surface-inset); }
.shell-btn,.btn { border-radius:9px; min-height:38px; font-weight:600; }
.shell-btn { background:var(--shell-accent); color:var(--action-text); border-color:var(--shell-accent); }
.shell-btn--primary,.btn--primary { background:var(--shell-accent); color:var(--action-text); border-color:var(--shell-accent); }
.shell-btn--ghost,.btn--ghost { background:transparent; border-color:var(--border); color:var(--text); }
.shell-modal,.log-modal,.notif-panel { background:var(--card); color:var(--text); border-color:var(--border); }
.sheet-modal__body,.sheet-modal__empty,.log-modal-body { background:var(--card); color:var(--text); }
.notif-policy { padding:10px 16px; margin:0; color:var(--muted); font-size:11px; line-height:1.6; border-bottom:1px solid var(--border); }
.notif-panel__header,.notif-panel__toolbar,.notif-panel__actions,.notif-item { border-color:var(--border); }
.notif-item { background:var(--surface-inset); }
.notif-filter { color:var(--muted); border-color:var(--border); }
.notif-filter.is-active { background:var(--selected-bg); color:var(--selected-text); border-color:var(--selected-bg); }
.notif-item--unread { background:var(--orange-soft); border-color:var(--shell-accent); }
.notif-item__title,.notif-item__body { color:var(--text); }
.push-enable-banner,.push-toast { background:var(--card); color:var(--text); border-color:var(--border); box-shadow:var(--shadow); }
.push-toast__text { color:var(--text); }
.push-toast__time,.notif-item__time { color:var(--muted); }
.notif-chip--critical,.shell-badge--blocked { background:var(--danger-soft); color:var(--red); }
.notif-chip--service,.shell-badge--active { background:var(--ok-soft); color:var(--green); }
.page-loading { background:var(--bg-0); color:var(--text); }
.page-loading__spinner { border-color:var(--border); border-top-color:var(--shell-accent); }
.login-card { background:var(--card); border-color:var(--border); box-shadow:var(--shadow); }
.login-brand__logo { color:var(--shell-accent); border-color:var(--border); background:var(--orange-soft); }
.login-brand .theme-toggle { margin-top:14px; }
.login-btn { background:var(--shell-accent); color:var(--action-text); }
.field input,.field select,.field textarea { background:var(--surface-inset); color:var(--text); border-color:var(--border); }
.field span,.login-foot a { color:var(--text); }
.shell-back-btn { background:var(--card); color:var(--text); border-color:var(--border); }
.version-box,.update-status,.update-progress__track { background:var(--surface-inset); border-color:var(--border); }
.update-progress__bar { background:var(--shell-accent); }
.update-progress__pct { color:var(--shell-accent); }
.summary-card { background:var(--orange-soft); border-color:var(--border); }
.btn--danger,.alert,.error-card__msg { background:var(--danger-soft); color:var(--red); border-color:var(--red); }
.toast { background:var(--card); color:var(--text); }
.updates-header > .theme-toggle { margin-left:auto; }
@media (max-width:1150px) and (min-width:901px) { .machine-list { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:900px) {
  .shell-layout { grid-template-columns:minmax(0,1fr); }
  .shell-sidebar { background:var(--shell-sidebar); }
  #menuBtn { display:grid; }
  .shell-main--monitor .app { padding:calc(16px + var(--safe-top)) 18px calc(26px + var(--safe-bottom)); }
  .app-header h1 { font-size:22px; }
}
@media (max-width:600px) {
  .shell-main { padding:18px 12px; }
  .shell-main--monitor { padding:0; }
  .shell-main--monitor .app { padding-left:max(12px,var(--safe-left)); padding-right:max(12px,var(--safe-right)); }
  .app-header { gap:9px; align-items:center; padding-bottom:15px; }
  .app-header h1 { font-size:20px; }
  .header-actions { gap:5px; }
  .icon-btn { width:32px; height:32px; border-radius:8px; }
  #refreshBtn { display:none; }
  .theme-toggle { height:32px; padding:0 9px; font-size:11px; }
  .monitor-toolbar { padding:10px; gap:9px; border-radius:13px; }
  .search-row { flex-basis:150px; }
  .search-field { height:36px; padding:0 10px; }
  .search-field input { font-size:12px; }
  .advanced-filters summary { font-size:11px; height:36px; padding:9px; }
  .monitor-filters { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .filter-tabs { gap:5px; }
  .filter-tab { padding:7px 8px; min-height:32px; font-size:11px; }
  .filter-tab__count { margin-left:2px; padding:1px 4px; font-size:10px; }
  .machine-list { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .machine-card { border-radius:14px; }
  .machine-card__inner { padding:11px; }
  .machine-card__top { gap:4px; margin-bottom:14px; }
  .status-chip { font-size:10px; padding:4px 5px; }
  .mini-chip { font-size:9px; }
  .machine-card__title { font-size:18px; min-height:44px; letter-spacing:-.6px; }
  .machine-card__subtitle { font-size:10px; margin:7px 0 13px; min-height:24px; }
  .machine-card .metric-row { padding:6px 8px; min-height:32px; }
  .machine-card .metric-row__label { font-size:9px; letter-spacing:0; }
  .machine-card .metric-row__value { font-size:17px; }
  .detail-header__title { font-size:17px; }
  .detail-breadcrumb { font-size:9px; }
  .hero-card { padding:17px; }
  .hero-card__title { font-size:28px; }
  .hero-metrics { grid-template-columns:minmax(0,1fr); gap:7px; }
  .hero-metrics .metric-row { gap:8px; padding:10px 12px; }
  .hero-metrics .metric-row__value { font-size:24px; }
  .action-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .action-card { min-height:118px; }
}
@media (max-width:350px) {
  .machine-card__title { font-size:16px; min-height:58px; }
  .filter-tab { padding:7px 5px; }
  .machine-card__inner { padding:9px; }
  .machine-card .metric-row { gap:4px; padding:6px; }
  .machine-card .metric-row__label { font-size:8px; }
  .machine-card .metric-row__value { font-size:15px; white-space:nowrap; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms !important; transition-duration:.01ms !important; } }
