:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1a2332;
  --muted: #5c6b7a;
  --accent: #0f5ea8;
  --accent-hover: #0c4d88;
  --border: #dce3eb;
  --danger: #b42318;
  --ok: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  background: #0b1f33;
  color: #fff;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar strong {
  font-size: 1.05rem;
}

.topbar .tagline {
  color: #9eb4c8;
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
}

.topnav a {
  color: #e8f0f8;
  font-size: 0.92rem;
  padding: 0.25rem 0;
}

.topnav a:hover {
  color: #fff;
}

.wrap {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(11, 31, 51, 0.06);
}

.card h1,
.card h2 {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.metric {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.metric label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 1.65rem;
  margin-top: 0.25rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.btn,
button[type="submit"] {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 0.95rem;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover,
button[type="submit"]:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: #fff;
}

.btn.secondary {
  background: #e8eef4;
  color: var(--text);
}

.btn.secondary:hover {
  background: #d7e2ec;
  color: var(--text);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data th,
table.data td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

table.data th {
  background: #f3f7fb;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

table.data tr:hover td {
  background: #fafcfe;
}

.flash {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
  background: #eef6ff;
}

.flash.error,
.alert-error {
  background: #fef3f2;
  border-color: #fecdca;
  color: var(--danger);
}

.flash.ok {
  background: #ecfdf3;
  border-color: #abefc6;
  color: var(--ok);
}

.form label {
  display: block;
  font-weight: 600;
  margin: 0.75rem 0 0.3rem;
  font-size: 0.9rem;
}

.form input,
.form select {
  width: 100%;
  max-width: 420px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.login-box {
  max-width: 400px;
  margin: 2rem auto;
}

.login-brand {
  text-align: center;
  margin-bottom: 0.5rem;
}

.brand-logo {
  max-width: min(100%, 280px);
  height: auto;
  max-height: 72px;
  display: block;
  object-fit: contain;
}

.login-brand .brand-logo {
  margin: 0 auto 0.75rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.topbar-brand .brand-logo {
  max-height: 38px;
  max-width: 120px;
  margin: 0;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: #e8eef4;
}

.pill.ok {
  background: #d1fadf;
  color: var(--ok);
}

.pill.warn {
  background: #fef0c7;
  color: #93370d;
}

.pill.bad {
  background: #fee4e2;
  color: var(--danger);
}

.pill.info {
  background: #d1e9ff;
  color: #175cd3;
}

.pill.auth {
  background: #ffe4d0;
  color: #b93815;
}

.pill.muted {
  background: #eef2f6;
  color: var(--muted);
}

.sync-logs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-chips .chip {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background: #eef2f6;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
}

.filter-chips .chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.filter-chips .chip:hover {
  text-decoration: none;
}

.sync-logs-filters .search-wrap {
  flex: 1 1 200px;
  min-width: 180px;
}

.sync-logs-filters .search-wrap input {
  width: 100%;
  margin-top: 0.2rem;
}

.sync-logs-table .mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
}

.log-details {
  font-size: 0.82rem;
}

.log-details summary {
  cursor: pointer;
  color: var(--accent);
  user-select: none;
}

.log-details-pre {
  margin: 0.35rem 0 0;
  padding: 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 320px;
  max-height: 120px;
  overflow: auto;
}

.cleanup-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.message-cell {
  max-width: 280px;
  word-break: break-word;
}

.btn.secondary.danger {
  color: var(--danger);
  border-color: #fecdca;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.report-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.88rem;
}

.portal-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-login-wrap {
  width: 100%;
  max-width: 440px;
  margin: 2rem auto;
}

.portal-login-card {
  padding: 1.5rem 1.75rem;
}

.form-stack label {
  display: block;
  font-weight: 600;
  margin: 0.75rem 0 0.3rem;
  font-size: 0.9rem;
}

.form-stack input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.portal-readonly-banner {
  font-size: 0.88rem;
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  background: #eef4fa;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.portal-topbar .topnav a.active {
  text-decoration: underline;
  font-weight: 600;
}

tr.row-warn td {
  background: #fff8f0;
}

tr.row-unread td {
  background: #fff9e6;
  font-weight: 500;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font: inherit;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}

.form-inline label {
  font-size: 0.88rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  .topnav {
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* —— Portal shell: grouped sidebar navigation —— */
:root {
  --sidebar-w: 260px;
  --sidebar-bg: #0b1f33;
  --sidebar-fg: #c5d4e3;
  --sidebar-muted: #7a92a8;
  --sidebar-active-bg: rgba(15, 94, 168, 0.35);
  --sidebar-active-fg: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
}

.portal-app {
  min-height: 100vh;
}

.portal-shell {
  display: flex;
  min-height: 100vh;
}

.portal-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-logo {
  max-height: 40px;
  max-width: 52px;
  margin: 0;
}

.sidebar-title {
  display: block;
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.25;
}

.sidebar-subtitle {
  display: block;
  font-size: 0.75rem;
  color: var(--sidebar-muted);
  margin-top: 0.1rem;
}

.sidebar-nav {
  padding: 0.5rem 0.65rem 1.25rem;
  flex: 1;
}

.nav-section {
  margin-bottom: 0.35rem;
}

.nav-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9eb4c8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
}

.nav-section-toggle:hover {
  background: var(--sidebar-hover);
  color: #e8f0f8;
}

.nav-section-toggle .nav-chevron {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.nav-section-toggle.is-open .nav-chevron {
  transform: rotate(180deg);
}

.nav-section-panel {
  padding: 0.15rem 0 0.35rem 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  margin: 0.1rem 0;
  border-radius: 8px;
  color: var(--sidebar-fg);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-fg);
  font-weight: 600;
}

.nav-item.active .nav-svg {
  opacity: 1;
}

.nav-item-logout {
  color: #f5b5b0;
}

.nav-item-logout:hover {
  background: rgba(180, 35, 24, 0.2);
  color: #fff;
}

.nav-item-external .nav-ext {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.65;
}

.nav-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-badge {
  margin-left: auto;
  min-width: 1.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}

.portal-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.portal-mobile-bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.portal-mobile-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.sidebar-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
}

.sidebar-hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.sidebar-backdrop {
  display: none;
}

/* In-page content tabs (single card, multiple panels) */
.content-tabs-card {
  padding: 0;
  overflow: hidden;
}

.content-tabs-card .portal-page-head {
  padding: 1.25rem 1.25rem 0;
}

.content-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.content-tab {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.65rem 0.9rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
}

.content-tab:hover {
  color: var(--accent);
  background: rgba(15, 94, 168, 0.06);
}

.content-tab.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
  background: var(--card);
}

.content-tab-panel {
  display: none;
  padding: 1.25rem;
}

.content-tab-panel.active {
  display: block;
}

.content-tab-panel[hidden] {
  display: none !important;
}

#offline-license-page .content-tab-panel:not(.active) {
  display: none !important;
}

#store-detail-page .sd-tab-panel:not(.active) {
  display: none !important;
}

#smart-management-page .mgmt-panel:not(.active) {
  display: none !important;
}

#smart-management-page .mgmt-panel.active {
  display: block !important;
}

.tab-list-plain {
  margin: 0;
  padding-left: 1.25rem;
}

.tab-list-plain li {
  margin-bottom: 0.5rem;
}

.portal-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2.5rem;
  box-sizing: border-box;
}

.portal-content .card h1 {
  font-size: 1.35rem;
}

/* Legacy topbar hidden when using portal shell */
.portal-app > .topbar {
  display: none;
}

@media (max-width: 900px) {
  .portal-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  }

  body.sidebar-open .portal-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(11, 31, 51, 0.45);
    z-index: 90;
  }

  .portal-mobile-bar {
    display: flex;
  }

  .portal-content {
    padding: 1rem 1rem 2rem;
  }
}

/* --------------------------------------------------------------------------
   Offline Licenses admin page (/admin/offline-licenses)
   -------------------------------------------------------------------------- */

.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;
}

.ol-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
  overflow-x: hidden;
}

.ol-page-header {
  padding: 1.35rem 1.5rem 1.25rem;
  border-left: 4px solid var(--accent);
}

.ol-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: var(--text);
}

.ol-subtitle {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.55;
  max-width: 44rem;
}

.ol-panel--status .ol-panel-head {
  margin-bottom: 0.75rem;
}

.ol-security-notes {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  line-height: 1.5;
}

.ol-security-notes li + li {
  margin-top: 0.3rem;
}

.ol-callout {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
}

.ol-callout-title {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.ol-callout-text {
  margin: 0;
  color: var(--text);
}

.ol-callout--warn {
  background: #fffbeb;
  border-color: #fcd34d;
}

.ol-callout--info {
  background: #eff6ff;
  border-color: #93c5fd;
}

.ol-advanced {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.85rem 0.75rem;
  background: #f8fafc;
}

.ol-advanced-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  list-style: none;
}

.ol-advanced-summary::-webkit-details-marker {
  display: none;
}

.ol-advanced-body {
  margin-top: 0.65rem;
  font-size: 0.86rem;
  line-height: 1.55;
}

.ol-advanced-body ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.ol-advanced-body li + li {
  margin-top: 0.35rem;
}

.ol-ac-wrap {
  position: relative;
}

.ol-ac-list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.ol-ac-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.ol-ac-item:last-child {
  border-bottom: none;
}

.ol-ac-item:hover,
.ol-ac-item--active {
  background: #eff6ff;
}

.ol-ac-rec {
  color: #15803d;
  font-weight: 600;
  font-size: 0.78rem;
}

.ol-ac-note {
  color: #64748b;
  font-size: 0.78rem;
}

.ol-ac-item-title {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.ol-ac-item-sub,
.ol-ac-item-meta {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

.ol-ac-empty {
  padding: 12px;
  font-size: 0.88rem;
  color: var(--muted);
}

.ol-selected-panel {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #f8fafc;
}

.ol-selected-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.ol-readonly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem 1rem;
}

.ol-ro-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.ol-input-readonly {
  background: #f1f5f9 !important;
  color: var(--text);
  cursor: default;
}

.ol-confirm-preview {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.ol-success-for {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  font-size: 0.94rem;
  line-height: 1.55;
}

.ol-advanced--form,
.ol-advanced--table {
  margin-top: 1rem;
}

.ol-panel-meta--tight {
  margin-top: 0.35rem;
}

.ol-panel--success {
  border: 1px solid #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 42%);
}

.ol-success-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: #065f46;
}

.ol-success-lede {
  margin: 0 0 1rem;
  font-size: 0.94rem;
  color: #047857;
}

.ol-success-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem 1.25rem;
  margin: 0 0 1.1rem;
  padding: 0;
}

.ol-success-meta div {
  margin: 0;
}

.ol-success-meta dt {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.15rem;
}

.ol-success-meta dd {
  margin: 0;
  font-size: 0.95rem;
}

.ol-code-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
}

.ol-code-area--large {
  font-size: 0.9rem;
  min-height: 6.5rem;
}

.ol-code-input {
  width: 100%;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 1rem;
  letter-spacing: 0.04em;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 6px;
  background: #f8fafc;
}

.ol-code-input--short {
  font-weight: 600;
  text-transform: uppercase;
}

.ol-advanced--issued {
  margin-top: 1rem;
}

.ol-pill-warn {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  vertical-align: middle;
}

.ol-row-warn {
  font-size: 0.78rem;
  margin-top: 0.25rem;
  max-width: 28rem;
}

.ol-row-meta td {
  padding-top: 0;
  padding-bottom: 0.65rem;
  border-top: none;
  font-size: 0.82rem;
}

.ol-meta-line {
  margin-right: 1.25rem;
}

.ol-plan-cell {
  font-size: 0.85rem;
  max-width: 10rem;
}

.ol-desktop-hint {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.ol-howto {
  margin-top: 1.15rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.ol-howto-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.ol-howto-steps {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.ol-warning {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #78350f;
}

.ol-status-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.ol-status-title {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.ol-status {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.ol-status-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
}

.ol-status--ok {
  background: linear-gradient(135deg, #ecfdf5 0%, #f8fafc 100%);
  border-color: #a7f3d0;
}

.ol-status--warn {
  background: linear-gradient(135deg, #fffbeb 0%, #fdf8f3 100%);
  border-color: #fcd34d;
}

.ol-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.ol-status--ok .ol-status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(6, 118, 71, 0.2);
}

.ol-status--warn .ol-status-dot {
  background: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}


.ol-code-inline {
  font-size: 0.84em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(15, 94, 168, 0.08);
  color: var(--text);
}

.ol-issued-slot {
  padding: 0.95rem;
  border-radius: 10px;
  border: 1px solid #abefc6;
  background: #ecfdf3;
}

.ol-issued-label {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ok);
}

.ol-code-area {
  width: 100%;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #86efac;
  background: #fff;
  resize: vertical;
  min-height: 5rem;
  color: #0f172a;
}

.ol-issued-actions {
  margin-bottom: 0;
}

.ol-copy-btn {
  font-size: 0.9rem;
  font-weight: 600;
}

.pill.muted {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.ol-flash {
  margin-bottom: 0;
}

.ol-panel {
  overflow: hidden;
}

.ol-panel--narrow {
  max-width: 720px;
}

.ol-panel-head h2 {
  font-size: 1.08rem;
  margin: 0 0 0.25rem;
}

.ol-panel-meta {
  margin: 0;
  font-size: 0.86rem;
}

.ol-panel-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.ol-form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.ol-footer-note {
  font-size: 0.86rem;
}

.ol-form-grid {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.ol-field-span {
  grid-column: 1 / -1;
}

.ol-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.38rem;
  color: var(--text);
}

.ol-optional {
  font-weight: 400;
  color: var(--muted);
}

.ol-input,
.ol-select {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
}

.ol-input:focus,
.ol-select:focus {
  outline: 2px solid rgba(15, 94, 168, 0.35);
  outline-offset: 1px;
  border-color: var(--accent);
}

.ol-input-narrow {
  max-width: 140px;
}

.ol-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.ol-revoke-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.ol-revoke-input {
  flex: 1 1 260px;
  min-width: 200px;
}

.ol-table-wrap {
  overflow-x: auto;
  margin: 0.5rem -0.05rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.ol-manage-panel,
.ol-tab-panel,
.ol-tabs-card {
  min-width: 0;
}

.ol-manage-search {
  align-items: center;
}

.ol-manage-search input[type="search"] {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 440px;
}

.ol-manage-header {
  margin-bottom: 0.75rem;
}

.ol-manage-header h2 {
  margin: 0 0 0.35rem;
}

.ol-manage-filters {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0.85rem;
  margin: 0 0 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.ol-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
}

.ol-filter-search {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 360px;
}

.ol-manage-subtabs {
  margin-top: 0.5rem;
}

.ol-manage-subtab-bar {
  margin-bottom: 1rem;
}

.ol-manage-subpanel {
  min-width: 0;
}

.ol-store-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.ol-store-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: #fff;
  min-width: 0;
}

.ol-store-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ol-store-card-title h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.ol-store-card-meta {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
}

.ol-store-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: flex-start;
}

.ol-store-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.ol-store-reason {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
}

.ol-store-action-row {
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.ol-inline-form {
  display: inline;
}

.ol-store-settings {
  margin-top: 0.5rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
}

.ol-store-settings summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.35rem 0;
}

.ol-settings-form {
  margin-top: 0.65rem;
  max-width: 420px;
}

.ol-device-filters {
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ol-devices-table-wrap--full {
  max-height: none;
}

.ol-devices-table--admin {
  min-width: 980px;
}

.ol-device-cards-mobile {
  display: none;
  gap: 0.75rem;
}

.ol-device-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  background: #fff;
}

.ol-device-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.ol-device-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
}

.ol-device-card-meta dt {
  font-weight: 600;
  color: var(--muted, #64748b);
}

.ol-device-card-meta dd {
  margin: 0;
}

.ol-commands-toolbar {
  margin-bottom: 1rem;
}

.ol-commands-actions {
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.ol-commands-device-refresh input[type="text"] {
  width: 10rem;
  max-width: 100%;
  margin-right: 0.25rem;
}

.ol-entitlement-list {
  display: grid;
  gap: 1rem;
  min-width: 0;
  margin-top: 1rem;
}

.ol-entitlement-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.25rem;
  align-items: start;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.ol-device-table-card {
  min-width: 0;
  overflow: hidden;
}

.ol-store-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(120px, 1fr));
  gap: 0.75rem;
  min-width: 0;
  margin-bottom: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.ol-store-summary > div,
.ol-store-main {
  min-width: 0;
}

.ol-store-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ol-truncate {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ol-actions-card {
  width: 100%;
  min-width: 320px;
  position: sticky;
  top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.ol-actions-card .ol-store-actions {
  min-width: 0;
}

.ol-actions-card select,
.ol-actions-card input[type="text"],
.ol-actions-card input[type="datetime-local"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.ol-actions-card .btn-row {
  margin-bottom: 0;
}

.ol-inline-check--flush {
  margin-left: 0;
}

.ol-table.ol-table td,
.ol-table.ol-table th {
  white-space: nowrap;
}

.ol-table .ol-mono {
  word-break: break-all;
  white-space: normal;
}

.ol-mono-sm {
  font-size: 0.78rem;
}

.ol-devices-cell {
  min-width: 320px;
  max-width: 520px;
  vertical-align: top;
}

.ol-devices-summary {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.ol-devices-details summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--muted, #64748b);
  margin-bottom: 0.35rem;
}

.ol-devices-table-wrap {
  overflow-x: auto;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.ol-devices-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.ol-devices-table th,
.ol-devices-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ol-devices-table th {
  background: var(--surface-2, #f8fafc);
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ol-devices-table th:nth-child(1),
.ol-devices-table td:nth-child(1) {
  width: 150px;
}

.ol-devices-table th:nth-child(2),
.ol-devices-table td:nth-child(2) {
  width: 145px;
}

.ol-devices-table th:nth-child(3),
.ol-devices-table td:nth-child(3) {
  width: 90px;
}

.ol-devices-table th:nth-child(4),
.ol-devices-table td:nth-child(4),
.ol-devices-table th:nth-child(5),
.ol-devices-table td:nth-child(5) {
  width: 105px;
}

.ol-devices-table th:nth-child(6),
.ol-devices-table td:nth-child(6),
.ol-devices-table th:nth-child(7),
.ol-devices-table td:nth-child(7) {
  width: 115px;
}

.ol-devices-table th:nth-child(8),
.ol-devices-table td:nth-child(8) {
  width: 190px;
}

.ol-device-latest {
  background: rgba(34, 197, 94, 0.08);
}

.ol-device-archived {
  opacity: 0.72;
}

.ol-badge-latest {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.68rem;
  vertical-align: middle;
}

.ol-device-actions {
  min-width: 0;
  white-space: normal !important;
  overflow: visible !important;
}

.ol-device-action-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ol-store-device-btns {
  margin-bottom: 0.5rem;
}

.ol-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
  font-size: 0.88rem;
  min-width: 0;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .ol-entitlement-layout {
    grid-template-columns: 1fr;
  }

  .ol-actions-card {
    position: static;
    min-width: 0;
  }

  .ol-store-summary {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  .ol-tab-panel {
    padding: 0.85rem;
  }

  .ol-entitlement-layout {
    padding: 0.75rem;
  }

  .ol-manage-search,
  .ol-manage-filters {
    align-items: stretch;
  }

  .ol-manage-search input[type="search"],
  .ol-manage-search .btn,
  .ol-filter-search,
  .ol-manage-filters .btn {
    flex-basis: 100%;
    max-width: none;
  }

  .ol-store-cards {
    grid-template-columns: 1fr;
  }

  .ol-devices-table-wrap--full {
    display: none;
  }

  .ol-device-cards-mobile {
    display: grid;
  }

  .ol-inline-check {
    margin-left: 0;
    white-space: normal;
  }
}

.ol-devices-empty {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
}

.ol-empty {
  padding: 1.25rem !important;
  text-align: center;
}

.card.ol-page-header {
  margin-bottom: 0;
}

.portal-content .ol-page-header .ol-title {
  font-size: 1.5rem;
}

/* System Health (developer) */
.sys-health-card {
  margin-top: 1rem;
}

.sys-health-card h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.sys-subhead {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
}

.sys-check-list,
.sys-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sys-check-item,
.sys-checklist-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.sys-check-item:last-child,
.sys-checklist-item:last-child {
  border-bottom: none;
}

.sys-check-detail {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
}

.sys-last-error {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 8px;
}

.sys-log-snippet {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 8rem;
  overflow: auto;
}

.sys-restart-note {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f0f7ff;
  border-radius: 8px;
}

.sys-config-table th {
  width: 42%;
  font-weight: 600;
}

.sys-check-icon {
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--ok);
  min-width: 1.25rem;
}

.sys-checklist-item .sys-check-icon {
  color: var(--muted);
}

.sys-checklist-item .sys-ok-text + .muted ~ *,
.sys-checklist-item:has(.sys-ok-text) .sys-check-icon {
  color: var(--ok);
}

.sys-ok-text {
  color: var(--ok);
}

.sys-warn-text {
  color: var(--danger);
}

/* Stores admin */
.stores-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.stores-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin: 1rem 0;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stores-filter-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.stores-filter-label input,
.stores-filter-label select {
  min-width: 140px;
}

.stores-filter-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  padding-bottom: 0.35rem;
}

.table-scroll {
  overflow-x: auto;
}

.stores-table .stores-last-seen {
  display: block;
  font-size: 0.8rem;
}

.stores-actions-cell {
  position: relative;
  white-space: nowrap;
}

.stores-actions-wrap {
  position: relative;
  display: inline-block;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.stores-actions-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 40;
  min-width: 220px;
  margin-top: 0.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 30, 50, 0.12);
  padding: 0.35rem 0;
}

.stores-actions-menu a,
.stores-actions-menu .stores-menu-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.85rem;
  border: none;
  background: none;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.stores-actions-menu a:hover,
.stores-actions-menu .stores-menu-btn:hover {
  background: #f0f4f8;
}

.stores-menu-warn {
  color: #b45309;
}

.stores-menu-danger {
  color: var(--danger);
  font-weight: 600;
}

.stores-modal {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 480px;
  width: calc(100% - 2rem);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.stores-modal::backdrop {
  background: rgba(11, 31, 51, 0.45);
}

.stores-modal-form {
  padding: 1.25rem 1.5rem 1.5rem;
}

.stores-modal h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.stores-modal-danger .stores-danger-title {
  color: var(--danger);
}

.stores-danger-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.92rem;
}

.stores-btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.stores-btn-danger:hover {
  filter: brightness(0.92);
}

.stores-delete-modes {
  border: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.stores-delete-mode {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.92rem;
  cursor: pointer;
}

.stores-delete-mode input {
  margin-top: 0.2rem;
}

.stores-delete-delete-extra {
  margin-bottom: 0.75rem;
}

.stores-delete-backup-opt {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.9rem;
  margin: 0.5rem 0 0.75rem;
}

.stores-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stores-device-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pill.warn {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

/* Offline License tabs + tooltips */
.ol-header-compact .ol-subtitle {
  margin: 0.25rem 0 0;
}

.ol-tabs-card {
  padding: 0;
  overflow: hidden;
}

.ol-tabs-card .ol-tab-bar {
  padding: 0 1rem;
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.ol-tab-panel {
  padding: 1rem 1.25rem 1.5rem;
}

.ol-tab-panel[hidden] {
  display: none !important;
}

.info-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #f0f4f8;
  color: var(--accent);
  font-size: 0.75rem;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}

.info-tip-btn:hover,
.info-tip-btn[aria-expanded="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.info-tip-inline {
  width: 1rem;
  height: 1rem;
  font-size: 0.65rem;
  margin-left: 0.15rem;
  vertical-align: super;
}

.info-tooltip-bubble {
  position: absolute;
  z-index: 9999;
  max-width: min(320px, 92vw);
  padding: 0.65rem 0.85rem;
  background: #1a2332;
  color: #f0f4f8;
  font-size: 0.88rem;
  line-height: 1.45;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.info-tooltip-bubble[hidden] {
  display: none !important;
}

.ol-success-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem 1rem;
  margin: 1rem 0;
}

.ol-howto-collapse {
  margin-top: 1rem;
  font-size: 0.92rem;
}

.ol-howto-collapse summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.card-inner {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.ol-usage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
}

.ol-usage-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}

.ol-usage-filters input,
.ol-usage-filters select {
  min-width: 120px;
}

.ol-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ol-reason-cell {
  max-width: 200px;
  font-size: 0.82rem;
}

.ol-settings-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ol-settings-list li {
  padding: 0.4rem 0;
}

.ol-table--usage {
  font-size: 0.88rem;
}

/* Desktop App Updates */
.upd-page-head {
  margin-bottom: 1rem;
}

.upd-page-head h1 {
  margin: 0 0 0.35rem;
}

.upd-page-head > .muted {
  margin: 0 0 0.75rem;
  max-width: 52rem;
}

.upd-advanced {
  max-width: 40rem;
}

.upd-code {
  display: block;
  margin-top: 0.35rem;
  padding: 0.45rem 0.6rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  word-break: break-all;
}

.upd-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.upd-form {
  max-width: 520px;
}

.form-hint {
  display: block;
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.form-stack textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.upd-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  margin-top: 1rem;
}

.upd-check input {
  width: auto;
}

.upd-check-hint {
  margin-top: 0.2rem;
}

.upd-confirm-dup {
  color: var(--danger);
  margin-top: 0.75rem;
}

.upd-badges {
  white-space: nowrap;
}

.upd-badges .pill + .pill {
  margin-left: 0.25rem;
}

.upd-link-cell a {
  word-break: break-all;
}

.upd-notes-cell {
  max-width: 14rem;
}

.upd-clear-all-form {
  margin-top: 12px;
}

.upd-store-target {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 12px 14px 10px;
  margin: 0 0 12px;
}

.upd-store-target legend {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0 4px;
}

.upd-store-picker {
  margin-top: 10px;
}

.upd-store-picker.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.upd-store-filter {
  width: 100%;
  max-width: 420px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
}

.upd-store-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--card-bg, #fff);
}

.upd-store-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.upd-store-code {
  font-weight: 600;
  min-width: 5rem;
}

.upd-stores-cell {
  font-size: 0.85rem;
  max-width: 140px;
}

.upd-actions-cell {
  white-space: nowrap;
}

.upd-inline-form {
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}

.upd-action-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

.table-wrap {
  overflow-x: auto;
}

.inbox-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 1rem;
}

.inbox-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}

.inbox-stat-card.active {
  border-color: var(--accent, #0891b2);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.15);
}

.inbox-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
}

.inbox-stat-label {
  font-size: 0.78rem;
  color: var(--muted, #64748b);
}

.inbox-tabs {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}

.inbox-table {
  font-size: 0.88rem;
}

.reg-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.reg-modal[hidden] {
  display: none !important;
}

.reg-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.reg-modal-panel {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.reg-modal-panel--wide {
  max-width: 520px;
}

.reg-summary-list {
  margin: 0 0 16px;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.reg-pin-fieldset {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 12px 0;
}

.reg-pin-fieldset label {
  display: block;
  margin: 6px 0;
  font-weight: 500;
}

/* Product list snapshots */
.pls-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin: 1rem 0;
}
.pls-save-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}
.pls-save-title {
  min-width: 220px;
  padding: 0.4rem 0.5rem;
}
.pls-last-qty {
  width: 5.5rem;
  padding: 0.25rem 0.35rem;
}
.pls-status {
  margin: 0;
  font-size: 0.9rem;
  width: 100%;
}
.pls-status.ok { color: #047857; }
.pls-status.error { color: #b91c1c; }
.pls-actions { white-space: nowrap; }
.pls-actions .btn { margin-right: 0.35rem; }
.pls-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow: auto;
}
.pls-modal[hidden] { display: none !important; }
.pls-modal-card {
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}
.pls-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
