:root {
  --ui-bg: #f4f5f2;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f8f9f7;
  --ui-sidebar: #18211f;
  --ui-sidebar-hover: #25302d;
  --ui-text: #18201e;
  --ui-muted: #68736f;
  --ui-line: #dfe4e0;
  --ui-accent: #16735f;
  --ui-accent-soft: #e4f2ed;
  --ui-blue: #426b8c;
  --ui-amber: #a9661d;
  --ui-danger: #b5444d;
  --ui-shadow: 0 8px 24px rgba(24, 32, 30, .055);
  font-family: Inter, "Microsoft YaHei", sans-serif;
  color: var(--ui-text);
  background: var(--ui-bg);
}

body { min-width: 320px; background: var(--ui-bg); }
button { border-radius: 7px; transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 120ms ease; }
button:active { transform: scale(.97); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(22, 115, 95, .2); outline-offset: 2px; }
.primary, .login-card form button { border-color: var(--ui-accent); background: var(--ui-accent); }
.primary:hover, .login-card form button:hover { background: #105e4e; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Login */
.login-shell { background: var(--ui-bg); }
.login-card { width: min(420px, calc(100vw - 32px)); padding: 36px; border: 1px solid var(--ui-line); border-radius: 8px; box-shadow: var(--ui-shadow); }
.brand-mark, .side-brand b { border-radius: 8px; background: var(--ui-accent); }
.login-card > small, header small, .dialog-head small { color: var(--ui-accent); letter-spacing: .1em; }
.login-card h1 { color: var(--ui-text); letter-spacing: 0; }
.login-card p { color: var(--ui-muted); }
input, textarea, select { border-color: var(--ui-line); border-radius: 7px; }
input:focus, textarea:focus, select:focus { border-color: var(--ui-accent); box-shadow: 0 0 0 3px rgba(22, 115, 95, .12); }

/* Shell */
.app-shell { grid-template-columns: 220px minmax(0, 1fr); background: var(--ui-bg); }
.app-shell > aside { z-index: 10; padding: 20px 14px; border-right: 0; background: var(--ui-sidebar); }
.side-brand { padding: 2px 6px 25px; }
.side-brand b { width: 36px; height: 36px; }
.side-brand strong { color: #f7faf8; }
.side-brand small { color: #8fa09b; }
.app-shell > aside nav { gap: 4px; }
.app-shell > aside nav button { position: relative; min-height: 40px; padding: 10px 12px 10px 42px; border: 0; color: #aebbb7; background: transparent; font-size: 12px; text-align: left; }
.app-shell > aside nav button::before { position: absolute; left: 13px; display: grid; width: 18px; height: 18px; place-items: center; border: 1px solid #52605c; border-radius: 5px; color: #91a09b; content: ""; font-size: 9px; }
.app-shell > aside nav button[data-page="releases"]::before { content: "V"; }
.app-shell > aside nav button[data-page="announcements"]::before { content: "N"; }
.app-shell > aside nav button[data-page="licenses"]::before { content: "L"; }
.app-shell > aside nav button[data-page="analytics"]::before { content: "A"; }
.app-shell > aside nav button[data-page="operations"]::before { content: "D"; }
.app-shell > aside nav button[data-page="account"]::before { content: "S"; }
.app-shell > aside nav button:hover { color: #fff; background: var(--ui-sidebar-hover); }
.app-shell > aside nav button.active { color: #fff; background: #2a3935; box-shadow: inset 3px 0 0 #56b79f; }
.app-shell > aside nav button.active::before { border-color: #56b79f; color: #d9f5ed; background: rgba(86, 183, 159, .12); }
.side-user { border-color: #35423e; }
.side-user span { color: #d6dfdc; }
.side-user button { color: #e49ca2; }

.workspace { max-width: 1480px; min-height: 100vh; padding: 32px 38px 54px; background: var(--ui-bg); }
.workspace > header { align-items: flex-end; margin-bottom: 24px; }
.workspace > header small { margin: 0 0 7px; color: var(--ui-accent); font-family: "Cascadia Mono", Consolas, monospace; font-size: 9px; }
.workspace > header h1 { margin: 0; color: var(--ui-text); font-size: 28px; letter-spacing: 0; }
.workspace > header p { max-width: 680px; margin-top: 8px; color: var(--ui-muted); font-size: 12px; line-height: 1.6; }
.panel, .summary-grid article { border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface); box-shadow: none; }
.panel { padding: 0; overflow: hidden; }
.panel-title { min-height: 76px; margin: 0; padding: 17px 20px; border-bottom: 1px solid var(--ui-line); }
.panel-title h2 { color: var(--ui-text); font-size: 15px; }
.panel-title p { margin-top: 5px; color: var(--ui-muted); line-height: 1.45; }
.release-list { padding: 12px; }
.release-row { border-radius: 7px !important; box-shadow: none; }
.release-row:hover { transform: none; border-color: #b9c8c2 !important; box-shadow: 0 4px 14px rgba(24, 32, 30, .05); }
.summary-grid { gap: 10px; margin-bottom: 14px; }
.summary-grid article { min-height: 104px; padding: 17px 18px; }
.summary-grid strong { color: var(--ui-text); }

/* Analytics header and tabs */
.analytics-hero { padding: 0; border: 0; background: transparent; }
.analytics-hero::after { display: none; }
.analytics-header-actions { display: flex; align-items: center; gap: 9px; }
.analytics-data-note { padding-right: 4px; color: var(--ui-muted); font-size: 10px; }
.analytics-header-actions button { border-color: var(--ui-line); color: #43504c; background: var(--ui-surface); }
.analytics-tabs { display: inline-flex; gap: 2px; margin: 0 0 16px; padding: 3px; border: 1px solid var(--ui-line); border-radius: 8px; background: #e9ece8; }
.analytics-tabs button { min-width: 88px; padding: 8px 12px; border: 0; border-radius: 5px; color: #5d6965; background: transparent; font-size: 11px; }
.analytics-tabs button:hover { color: var(--ui-text); background: rgba(255, 255, 255, .65); }
.analytics-tabs button.active { color: var(--ui-text); background: var(--ui-surface); box-shadow: 0 1px 4px rgba(24, 32, 30, .1); }

/* Analytics metrics */
#analyticsSummary.analytics-summary, #analyticsSummary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.analytics-metric { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 13px; min-height: 100px !important; padding: 16px !important; border-top: 0 !important; }
.analytics-metric::before { display: none; }
.analytics-metric .metric-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 7px; color: var(--ui-accent); background: var(--ui-accent-soft); font-size: 12px; font-weight: 800; }
.analytics-metric > div { display: grid; min-width: 0; }
.analytics-metric > div > span { color: #4d5955; font-size: 11px; font-weight: 700; }
.analytics-metric strong { margin: 3px 0 1px; font-family: "Cascadia Mono", Consolas, monospace; font-size: 25px !important; line-height: 1; }
.analytics-metric small { color: #89938f; font-size: 9px; }
.metric-qualified .metric-icon { color: var(--ui-blue); background: #e9eff4; }
.metric-devices .metric-icon { color: var(--ui-amber); background: #f7eee1; }
.metric-online .metric-icon { color: #a14857; background: #f7e9ec; }

.analytics-section-kicker { display: block; margin-bottom: 5px; color: var(--ui-accent); font-family: "Cascadia Mono", Consolas, monospace; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.analytics-panel-meta, .analytics-live-meta { color: #7c8783; font-family: "Cascadia Mono", Consolas, monospace; font-size: 9px; }
.analytics-live-meta { display: flex; align-items: center; gap: 6px; }
.analytics-live-meta i { width: 7px; height: 7px; border-radius: 50%; background: #35a77f; box-shadow: 0 0 0 3px #e1f4ec; }
.text-action { padding: 6px 0; border: 0; color: var(--ui-accent); background: transparent; font-size: 10px; }

/* Overview */
.analytics-overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr); gap: 14px; }
.analytics-trends { min-height: 322px; padding: 20px 22px 16px; overflow: hidden; }
.trend-chart-head { display: flex; align-items: end; gap: 26px; }
.trend-chart-head > div { display: grid; }
.trend-chart-head strong { font-family: "Cascadia Mono", Consolas, monospace; font-size: 19px; }
.trend-chart-head span { color: var(--ui-muted); font-size: 9px; }
.trend-chart-head .trend-legend { display: flex; flex-direction: row; gap: 13px; margin: 0 0 2px auto; }
.trend-legend span::before { display: inline-block; width: 16px; height: 2px; margin-right: 5px; border-radius: 0; content: ""; background: var(--ui-accent); vertical-align: 3px; }
.trend-legend span:nth-child(2)::before { background: var(--ui-blue); }
.trend-line-chart { margin-top: 14px; }
.trend-line-chart svg { display: block; width: 100%; height: 226px; overflow: visible; }
.trend-line-chart polyline { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.line-launches { stroke: var(--ui-accent); }
.line-qualified { stroke: var(--ui-blue); }
.chart-grid line { stroke: #e6eae7; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-labels text { fill: #87918d; font-family: "Cascadia Mono", Consolas, monospace; font-size: 8px; }
.analytics-recent { min-height: 322px; }
.analytics-recent article { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 62px; padding: 11px 18px; border-bottom: 1px solid #edf0ed; }
.analytics-recent article:last-child { border-bottom: 0; }
.recent-status { width: 7px; height: 7px; border-radius: 50%; background: #aeb7b3; }
.recent-status.qualified { background: #35a77f; }
.analytics-recent strong { display: block; color: #2a3431; font-size: 11px; }
.analytics-recent p, .analytics-recent span { margin: 3px 0 0; color: #84908b; font-size: 9px; }
.recent-location { min-width: 110px; text-align: right; }
.recent-location strong { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-location span { display: block; font-family: "Cascadia Mono", Consolas, monospace; }
.analytics-privacy-zone { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 14px; padding: 17px 19px; border: 1px solid #e7d5d7; border-radius: 8px; background: #fffafa; }
.analytics-privacy-zone > div { display: grid; gap: 3px; }
.analytics-privacy-zone span { color: var(--ui-danger); font-family: "Cascadia Mono", Consolas, monospace; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.analytics-privacy-zone strong { font-size: 13px; }
.analytics-privacy-zone p { margin: 0; color: #7c696c; font-size: 10px; line-height: 1.5; }
.danger-outline { border-color: #e3bfc3 !important; color: var(--ui-danger) !important; background: #fff !important; }
.danger-outline:hover { border-color: var(--ui-danger) !important; color: #fff !important; background: var(--ui-danger) !important; }

/* Session table */
.analytics-table-wrap { overflow-x: auto; }
.analytics-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.analytics-table th { padding: 11px 16px; border-bottom: 1px solid var(--ui-line); color: #818b87; background: var(--ui-surface-soft); font-size: 9px; font-weight: 700; text-align: left; }
.analytics-table th:nth-child(1) { width: 25%; }
.analytics-table th:nth-child(2) { width: 27%; }
.analytics-table th:nth-child(3) { width: 17%; }
.analytics-table th:nth-child(4) { width: 22%; }
.analytics-table th:last-child { width: 46px; }
.analytics-table td { height: 68px; padding: 11px 16px; border-bottom: 1px solid #edf0ed; color: #3b4642; font-size: 10px; vertical-align: middle; }
.analytics-table tbody tr:last-child td { border-bottom: 0; }
.analytics-table tbody tr:hover td { background: #fafbf9; }
.analytics-table td > strong, .analytics-table td > span { display: block; }
.analytics-table td > strong { margin-bottom: 4px; color: #27312e; font-size: 11px; }
.analytics-table td > span { color: #828d88; font-size: 9px; }
.table-ip { display: grid; gap: 2px; min-width: 0; }
.ip-address { color: #303b37; font-family: "Cascadia Mono", Consolas, monospace; font-size: 10px; }
.ip-location { overflow: hidden; color: var(--ui-accent); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.table-ip small, .ip-empty { color: #929b97; font-size: 8px; }
.analytics-status { display: inline-flex !important; width: max-content; margin: 0 0 5px !important; padding: 3px 7px; border-radius: 99px; font-size: 8px !important; font-weight: 800; }
.analytics-status.online { color: #1f7656; background: #e5f4ec; }
.analytics-status.ended { color: #6e7975; background: #edf0ee; }
.analytics-status.idle { color: #9a641d; background: #f8edda; }
.icon-danger { display: grid; width: 27px; height: 27px; padding: 0; place-items: center; border-color: transparent; color: #a96a70; background: transparent; font-size: 17px; font-weight: 400; }
.icon-danger:hover { color: var(--ui-danger); background: #fae9eb; }

/* Devices */
.analytics-device-grid { display: grid; gap: 8px; padding: 12px; background: var(--ui-surface-soft); }
.analytics-device-card { position: relative; border: 1px solid var(--ui-line); border-radius: 7px; background: var(--ui-surface); }
.analytics-device-card summary { display: grid; grid-template-columns: minmax(230px, 1.2fr) minmax(180px, 1fr) 100px 24px; align-items: center; gap: 16px; min-height: 76px; padding: 12px 16px; cursor: pointer; list-style: none; }
.analytics-device-card summary::-webkit-details-marker { display: none; }
.device-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.device-avatar { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--ui-accent); background: var(--ui-accent-soft); font-size: 12px; font-weight: 800; }
.device-identity strong, .device-activity strong { display: block; overflow: hidden; color: #28322f; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.device-identity p, .device-activity span, .device-count span { margin: 4px 0 0; color: #89938f; font-size: 9px; }
.device-activity { min-width: 0; }
.device-activity strong { color: var(--ui-accent); }
.device-count { text-align: right; }
.device-count strong { display: block; font-family: "Cascadia Mono", Consolas, monospace; font-size: 17px; }
.device-expand { color: #7f8b86; font-size: 17px; transition: transform 160ms ease; }
.analytics-device-card[open] .device-expand { transform: rotate(180deg); }
.analytics-device-card .device-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 1px 0 0; border-top: 1px solid var(--ui-line); background: var(--ui-line); }
.analytics-device-card .device-details > div { min-height: 70px; padding: 13px 16px; background: var(--ui-surface); }
.analytics-device-card .device-details span, .analytics-device-card .device-details strong { display: block; }
.analytics-device-card .device-details span { margin-bottom: 6px; color: #8a9490; font-size: 8px; }
.analytics-device-card .device-details strong { color: #3c4743; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.analytics-device-card .device-details button { align-self: center; justify-self: start; margin: 12px 16px; }

/* Modules and online */
.analytics-module-list { padding: 8px 18px 16px; }
.analytics-module-list article { display: grid; grid-template-columns: 34px minmax(0, 1fr) 90px; align-items: center; gap: 13px; min-height: 72px; border-bottom: 1px solid #edf0ed; }
.analytics-module-list article:last-child { border-bottom: 0; }
.module-rank { color: #9aa39f; font-family: "Cascadia Mono", Consolas, monospace; font-size: 10px; }
.analytics-module-list article > div { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.analytics-module-list article > div strong { font-size: 11px; }
.analytics-module-list article > div span { color: #89938f; font-size: 9px; }
.analytics-module-list article i { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 3px; background: #edf0ed; }
.analytics-module-list article i b { display: block; height: 100%; border-radius: inherit; background: var(--ui-accent); }
.analytics-module-list article > strong { justify-self: end; font-family: "Cascadia Mono", Consolas, monospace; font-size: 17px; }
.analytics-module-list article > strong small { color: #8c9692; font-size: 8px; }
.analytics-online-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px; background: var(--ui-surface-soft); }
.online-card { min-width: 0; padding: 15px; border: 1px solid var(--ui-line); border-radius: 7px; background: var(--ui-surface); }
.online-card-head { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding-bottom: 13px; border-bottom: 1px solid #edf0ed; }
.online-pulse { width: 7px; height: 7px; border-radius: 50%; background: #35a77f; box-shadow: 0 0 0 3px #e1f4ec; }
.online-card-head strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.online-card-head p { margin: 3px 0 0; color: #89938f; font-size: 9px; }
.online-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; padding-top: 14px; }
.online-facts span, .online-facts strong { display: block; }
.online-facts span { margin-bottom: 4px; color: #8b9591; font-size: 8px; }
.online-facts strong { overflow: hidden; color: #34403c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-tab-panel.hidden { display: none; }
.empty { color: #89938f; }

@media (max-width: 1100px) {
  .analytics-overview-grid { grid-template-columns: 1fr; }
  .analytics-online-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-device-card summary { grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) 80px 20px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .app-shell > aside { position: sticky; top: 0; display: grid; grid-template-columns: 1fr auto; height: auto; padding: 9px 11px; border-bottom: 1px solid #34423e; }
  .side-brand { padding: 0; }
  .app-shell > aside nav { grid-column: 1 / -1; display: flex; gap: 4px; margin-top: 7px; overflow-x: auto; }
  .app-shell > aside nav button { min-height: 34px; flex: 0 0 auto; padding: 8px 10px 8px 31px; }
  .app-shell > aside nav button::before { left: 8px; }
  .side-user { margin: 0; padding: 0; border: 0; }
  .workspace { min-height: calc(100vh - 96px); padding: 20px 13px 34px; }
  .workspace > header { display: block; }
  .workspace > header h1 { font-size: 24px; }
  .analytics-header-actions { display: grid; grid-template-columns: 1fr auto; margin-top: 14px; }
  .analytics-data-note { text-align: left; }
  .analytics-tabs { display: flex; margin-right: -13px; overflow-x: auto; border-right: 0; border-radius: 7px 0 0 7px; }
  .analytics-tabs button { min-width: 76px; }
  #analyticsSummary.analytics-summary, #analyticsSummary { grid-template-columns: 1fr 1fr; }
  .analytics-metric { min-height: 92px !important; grid-template-columns: 32px minmax(0, 1fr); gap: 9px; padding: 13px !important; }
  .analytics-metric .metric-icon { width: 32px; height: 32px; }
  .analytics-metric strong { font-size: 22px !important; }
  .analytics-overview-grid { grid-template-columns: 1fr; }
  .analytics-trends { min-height: 270px; padding: 16px 12px 10px; overflow-x: auto; }
  .trend-chart-head { min-width: 520px; }
  .trend-line-chart { min-width: 520px; }
  .analytics-privacy-zone { align-items: stretch; flex-direction: column; }
  .analytics-table { min-width: 760px; }
  .analytics-device-card summary { grid-template-columns: minmax(0, 1fr) 20px; gap: 10px; }
  .device-activity, .device-count { grid-column: 1; padding-left: 47px; text-align: left; }
  .device-expand { grid-column: 2; grid-row: 1; }
  .analytics-device-card .device-details { grid-template-columns: 1fr 1fr; }
  .analytics-online-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .login-card { padding: 28px 22px; }
  #analyticsSummary.analytics-summary, #analyticsSummary { grid-template-columns: 1fr; }
  .analytics-metric { min-height: 82px !important; }
  .analytics-recent article { grid-template-columns: 8px minmax(0, 1fr); }
  .recent-location { grid-column: 2; text-align: left; }
  .analytics-device-card .device-details { grid-template-columns: 1fr; }
  .online-facts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* License management */
#licensesPage .license-panel-title { align-items: center; gap: 20px; }
.license-section-kicker { display: block; margin-bottom: 5px; color: var(--ui-accent); font-family: "Cascadia Mono", Consolas, monospace; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
#licenseSummary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#licenseSummary .license-metric { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 13px; min-height: 100px; padding: 16px; }
.license-metric-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 7px; color: var(--ui-accent); background: var(--ui-accent-soft); font-size: 11px; font-weight: 800; }
.license-metric > div { display: grid; min-width: 0; }
.license-metric > div > span { color: #4d5955; font-size: 10px; font-weight: 700; }
#licenseSummary .license-metric strong { margin: 3px 0 1px; font-size: 25px; line-height: 1; }
.license-metric small { overflow: hidden; color: #89938f; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.license-metric.metric-unused .license-metric-icon { color: var(--ui-blue); background: #e9eff4; }
.license-metric.metric-expiring .license-metric-icon { color: var(--ui-amber); background: #f7eee1; }
.license-metric.metric-online .license-metric-icon { color: #a14857; background: #f7e9ec; }
.license-toolbar { display: grid; grid-template-columns: 132px minmax(210px, 1fr) auto; align-items: center; gap: 8px; width: min(540px, 55%); }
.license-toolbar label, .license-toolbar input, .license-toolbar select { width: 100%; min-width: 0; }
.license-toolbar input, .license-toolbar select, .license-toolbar button { height: 36px; font-size: 10px; }
.license-toolbar select { padding: 0 30px 0 10px; background: #fff; }
.license-search-field { position: relative; display: block; }
.license-search-mark { position: absolute; z-index: 1; top: 50%; left: 10px; color: #8b9691; font-size: 9px; font-weight: 800; transform: translateY(-50%); pointer-events: none; }
.license-search-field input { padding: 0 10px 0 31px; }
.license-toolbar button { padding: 0 12px; white-space: nowrap; }
.license-list { display: grid; gap: 8px; padding: 10px; border: 0; border-radius: 0; background: var(--ui-surface-soft); overflow: visible; }
.license-row { position: relative; display: grid; grid-template-columns: minmax(180px, .85fr) minmax(420px, 2fr) 184px; gap: 18px; align-items: center; min-width: 0; padding: 15px 16px 15px 19px; border: 1px solid var(--ui-line); border-radius: 7px; background: var(--ui-surface); transition: border-color 160ms ease, box-shadow 160ms ease; }
.license-row::before { position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 7px 0 0 7px; content: ""; background: #a9b3af; }
.license-row.status-active::before { background: var(--ui-accent); }
.license-row.status-unused::before { background: var(--ui-blue); }
.license-row.status-expired::before, .license-row.status-disabled::before { background: var(--ui-danger); }
.license-row:hover { border-color: #bccac4; box-shadow: 0 4px 14px rgba(24, 32, 30, .05); }
.license-code-cell { min-width: 0; display: grid; gap: 10px; }
.license-code-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.license-code-line > strong { overflow: hidden; color: #26312d; font: 700 12px "Cascadia Mono", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.license-validity { display: flex; align-items: center; gap: 7px; min-width: 0; }
.license-validity span, .license-field-label { color: #929b97; font-size: 8px; font-weight: 700; }
.license-validity b { overflow: hidden; color: #5d6965; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.license-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; min-width: 0; }
.license-facts > div { min-width: 0; display: grid; gap: 4px; padding: 0 15px; border-left: 1px solid #edf0ed; }
.license-facts strong, .license-facts small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.license-facts strong { color: #34403c; font-size: 10px; }
.license-facts small { color: #89938f; font-size: 8px; }
.license-row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 184px; max-width: none; }
.license-row-actions button { min-width: 0; min-height: 30px; padding: 5px 7px; border-color: var(--ui-line); border-radius: 6px; color: #53605b; background: #fff; font-size: 9px; white-space: nowrap; }
.license-row-actions button:hover { border-color: #9fb8ae; color: var(--ui-accent); background: #f6faf8; }
.license-row-actions .danger-outline:last-child:nth-child(odd) { grid-column: 1 / -1; }
.license-list > .empty { padding: 42px 18px; border: 1px dashed #cfd7d2; border-radius: 7px; background: #fff; text-align: center; }

#licenseDialog, #licenseResultDialog { width: min(700px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(20, 29, 26, .26); }
#licenseDialog::backdrop, #licenseResultDialog::backdrop { background: rgba(20, 29, 26, .5); backdrop-filter: blur(3px); }
#licenseDialog form, #licenseResultDialog .license-result-dialog { width: 100%; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
#licenseDialog .dialog-head, #licenseResultDialog .dialog-head { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 17px; border-bottom: 1px solid var(--ui-line); background: #f8faf7; }
#licenseDialog .dialog-head small, #licenseResultDialog .dialog-head small { display: block; margin-bottom: 5px; color: var(--ui-accent); font-family: "Cascadia Mono", Consolas, monospace; font-size: 8px; letter-spacing: .1em; }
#licenseDialog .dialog-head h2, #licenseResultDialog .dialog-head h2 { margin: 0; color: var(--ui-text); font-size: 19px; }
#licenseDialog .dialog-head p, #licenseResultDialog .dialog-head p { margin: 6px 0 0; color: var(--ui-muted); font-size: 10px; line-height: 1.55; }
#licenseDialog .dialog-head button, #licenseResultDialog .dialog-head button { width: 30px; height: 30px; flex: 0 0 30px; padding: 0; border-color: var(--ui-line); border-radius: 6px; color: #697570; background: #fff; font-size: 18px; line-height: 1; }
#licenseDialog .form-grid { min-height: 0; overflow-y: auto; padding: 20px 22px; }
#licenseDialog textarea { min-height: 100px; resize: vertical; }
#licenseDialog .dialog-actions, #licenseResultDialog .dialog-actions { flex: 0 0 auto; margin: 0; padding: 14px 22px; border-top: 1px solid var(--ui-line); background: #fafbf9; }
#licenseResultDialog textarea { min-height: 240px; margin: 20px 22px; width: calc(100% - 44px); resize: vertical; padding: 13px; border: 1px solid var(--ui-line); border-radius: 7px; color: #33403b; background: #f8faf9; font: 600 11px/1.8 "Cascadia Mono", Consolas, monospace; }

@media (max-width: 1180px) {
  #licensesPage .license-panel-title { align-items: stretch; flex-direction: column; }
  .license-toolbar { width: 100%; grid-template-columns: 132px minmax(180px, 1fr) auto; }
  .license-row { grid-template-columns: minmax(180px, .8fr) minmax(360px, 2fr); }
  .license-row-actions { grid-column: 1 / -1; width: 100%; grid-template-columns: repeat(5, minmax(0, 1fr)); padding-top: 11px; border-top: 1px solid #edf0ed; }
  .license-row-actions .danger-outline:last-child:nth-child(odd) { grid-column: auto; }
}
@media (max-width: 760px) {
  #licenseSummary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #licenseSummary .license-metric { min-height: 88px; grid-template-columns: 32px minmax(0, 1fr); gap: 9px; padding: 12px; }
  .license-metric-icon { width: 32px; height: 32px; }
  #licenseSummary .license-metric strong { font-size: 21px; }
  .license-metric small { display: none; }
  #licensesPage .license-panel-title { display: flex !important; gap: 13px; }
  .license-toolbar { grid-template-columns: 112px minmax(0, 1fr); }
  .license-toolbar button { grid-column: 1 / -1; width: 100%; }
  .license-list { padding: 7px; }
  .license-row { display: block; width: 100%; padding: 15px 13px 13px 16px; }
  .license-code-cell { gap: 8px; padding-bottom: 13px; }
  .license-code-line { justify-content: space-between; }
  .license-code-line > strong { font-size: 11px; }
  .license-facts { grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid #e8ece9; border-radius: 7px; background: #e8ece9; }
  .license-facts > div { min-height: 67px; padding: 10px; border: 0; background: #fafbf9; }
  .license-facts > div:last-child { grid-column: 1 / -1; }
  .license-facts strong, .license-facts small { white-space: normal; overflow-wrap: anywhere; }
  .license-row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; width: 100%; margin-top: 13px; padding-top: 12px; }
  .license-row-actions button { width: 100%; min-height: 36px; font-size: 9px; }
  .license-row-actions .danger-outline:last-child:nth-child(odd) { grid-column: 1 / -1; }
  #licenseDialog, #licenseResultDialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: 8px; }
  #licenseDialog form, #licenseResultDialog .license-result-dialog { max-height: calc(100dvh - 16px); }
  #licenseDialog .dialog-head, #licenseResultDialog .dialog-head { padding: 16px; }
  #licenseDialog .form-grid { padding: 16px; }
  #licenseDialog .dialog-actions, #licenseResultDialog .dialog-actions { grid-template-columns: 1fr 1fr !important; padding: 12px 16px; }
  #licenseResultDialog textarea { min-height: 180px; margin: 16px; width: calc(100% - 32px); }
}
@media (max-width: 390px) {
  #licenseSummary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #licenseSummary .license-metric { grid-template-columns: 1fr; gap: 7px; align-content: center; }
  .license-metric-icon { width: 27px; height: 27px; }
  .license-toolbar { grid-template-columns: 1fr; }
  .license-toolbar button { grid-column: auto; }
  .license-facts, .license-row-actions { grid-template-columns: 1fr; }
  .license-facts > div:last-child, .license-row-actions .danger-outline:last-child:nth-child(odd) { grid-column: auto; }
  #licenseDialog .dialog-actions, #licenseResultDialog .dialog-actions { grid-template-columns: 1fr !important; }
}

.operations-device-list { display: grid; gap: 8px; padding: 12px; background: var(--ui-surface-soft); }
.operations-list-title { align-items: start; }
.operations-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.operations-toolbar input { min-width: 220px; }
.operations-overview-actions { display: flex; align-items: end; gap: 10px; }
.operations-device-card { display: grid; grid-template-columns: minmax(200px, 1.2fr) minmax(150px, 1fr) 90px minmax(140px, 1fr) 140px 72px; align-items: center; gap: 16px; min-height: 78px; padding: 12px 16px; border: 1px solid var(--ui-line); border-radius: 7px; background: var(--ui-surface); cursor: pointer; text-align: left; color: inherit; }
.operations-device-card .device-customer strong { font-size: 12px; }
.operations-device-card:hover { border-color: #56b79f; }
.operations-device-card .device-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.operations-device-card .device-identity div { min-width: 0; }
.operations-device-card strong, .operations-device-card p, .operations-device-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operations-device-card p, .operations-device-card small { color: #8a9490; font-size: 10px; }
.operations-device-card .device-count strong { font-family: "Cascadia Mono", Consolas, monospace; font-size: 16px; }
.operations-device-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr) repeat(3, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.operations-device-head article { min-height: 88px; padding: 16px 18px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-surface); }
.operations-device-head small { display: block; margin-bottom: 6px; color: #8a9490; font-size: 9px; }
.operations-account-grid, .operations-overview-table { padding: 8px 18px 16px; }
.operations-account-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) 140px 90px; align-items: center; gap: 12px; min-height: 64px; border-bottom: 1px solid #edf0ed; }
.operations-account-card:last-child { border-bottom: 0; }
.operations-account-card .account-avatar, .operations-device-card .device-avatar { display: grid; width: 36px; height: 36px; place-items: center; overflow: hidden; border-radius: 8px; color: #d9f5ed; background: #2a3935; font-size: 12px; }
.operations-account-card .account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.operations-status { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; padding: 3px 8px; border-radius: 999px; font-size: 10px; }
.operations-status.online, .analytics-status.online { color: #1f7a63; background: #e8f7f1; }
.operations-status.offline { color: #8a9490; background: #eef1ef; }
.operations-status.logged-out { color: #9a6b12; background: #f7efd8; }
.operations-overview-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 12px; padding: 16px 18px 0; }
.operations-overview-toolbar label { display: grid; gap: 6px; color: #8a9490; font-size: 10px; }
.operations-overview-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 18px 12px; }
.operations-overview-metrics article { padding: 12px; border: 1px solid var(--ui-line); border-radius: 7px; background: var(--ui-surface-soft); }
.operations-overview-metrics strong { display: block; font-size: 16px; }
.operations-overview-metrics small { color: #8a9490; font-size: 9px; }
.operations-overview-table table { width: 100%; border-collapse: collapse; }
.operations-overview-table th, .operations-overview-table td { padding: 10px 8px; border-bottom: 1px solid #edf0ed; text-align: right; font-size: 11px; }
.operations-overview-table th:first-child, .operations-overview-table td:first-child, .operations-overview-table th:nth-child(2), .operations-overview-table td:nth-child(2) { text-align: left; }
.operations-device-modules { padding: 8px 0 0; }
@media (max-width: 980px) {
  .operations-device-card { grid-template-columns: minmax(0, 1fr) 80px; }
  .operations-device-card .device-count, .operations-device-card .device-sync, .operations-device-card .device-customer { display: none; }
  .operations-toolbar { justify-content: stretch; }
  .operations-toolbar input { min-width: 0; width: 100%; }
  .operations-device-head, .operations-overview-metrics { grid-template-columns: 1fr 1fr; }
}

.operations-account-card .account-avatar, .operations-account-cell .account-avatar { position: relative; display: grid; width: 36px; height: 36px; place-items: center; overflow: hidden; border-radius: 8px; color: #d9f5ed; background: #2a3935; font-size: 12px; }
.operations-account-card .account-avatar img, .operations-account-cell .account-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #2a3935; }
.operations-account-card .account-avatar b, .operations-account-cell .account-avatar b { font-weight: 700; }
.operations-account-cell { display: flex; align-items: center; gap: 10px; text-align: left; }
.operations-account-cell div { min-width: 0; }
.operations-account-cell strong, .operations-account-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operations-account-cell small { color: #8a9490; font-size: 9px; }
