    body { font-feature-settings: "cv02", "cv03", "cv04", "cv11", "tnum"; }
    ::-webkit-scrollbar { width: 5px; height: 5px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 9999px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.55); }
    .surface-glass { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
    .admin-readiness { box-sizing: border-box; }
    .admin-readiness-grid {
      overflow: hidden;
      border: 1px solid rgba(226, 232, 240, 0.95);
      border-radius: 0.85rem;
      background: #ffffff;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }
    .dark .admin-readiness-grid {
      border-color: rgba(255, 255, 255, 0.08);
      background: #181c23;
    }
    .admin-readiness-item {
      min-width: 0;
      display: grid;
      grid-template-columns: auto auto minmax(0, 1fr) auto;
      align-items: center;
      column-gap: 0.4rem;
      padding: 0.25rem 0.65rem;
      border-left: 1px solid rgba(226, 232, 240, 0.95);
      border-top: 1px solid rgba(226, 232, 240, 0.95);
      margin: -1px 0 0 -1px;
      color: #334155;
      font-size: 0.68rem;
      line-height: 1rem;
    }
    .dark .admin-readiness-item { border-color: rgba(255, 255, 255, 0.08); }
    .admin-readiness-label {
      font-size: 0.58rem;
      font-weight: 800;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      white-space: nowrap;
      color: #64748b;
    }
    .dark .admin-readiness-label { color: #94a3b8; }
    .dark .admin-readiness-item { color: #c3cad5; }
    .admin-readiness-icon { flex: none; width: 1rem; text-align: center; }
    .admin-icon {
      display: inline-block;
      width: 1em;
      height: 1em;
      flex: none;
      vertical-align: -0.125em;
    }
    .admin-icon-slot { display: inline-flex; flex: none; align-items: center; justify-content: center; }
    .admin-readiness-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; }
    .dark .admin-readiness-value { color: #94a3b8; }
    .admin-action-label {
      padding: 0.2rem 0.45rem;
      border-radius: 0.4rem;
      background: #f1f5f9;
      color: #64748b;
      font-size: 0.6rem;
      font-weight: 800;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }
    .dark .admin-action-label { background: rgba(255,255,255,.07); color: #94a3b8; }
    .admin-action-divider { width: 1px; height: 2rem; background: #cbd5e1; }
    .dark .admin-action-divider { background: rgba(255,255,255,.15); }
    .admin-readiness-item[data-state="good"] .admin-readiness-value { color: #047857; }
    .admin-readiness-item[data-state="good"] .admin-readiness-icon { color: #059669; }
    .dark .admin-readiness-item[data-state="good"] .admin-readiness-value { color: #8cc4ab; }
    .dark .admin-readiness-item[data-state="good"] .admin-readiness-icon { color: #8cc4ab; }
    .admin-readiness-item[data-state="warning"] .admin-readiness-value { color: #b45309; }
    .admin-readiness-item[data-state="warning"] .admin-readiness-icon { color: #d97706; }
    .dark .admin-readiness-item[data-state="warning"] .admin-readiness-value { color: #d3b67e; }
    .dark .admin-readiness-item[data-state="warning"] .admin-readiness-icon { color: #d3b67e; }
    .admin-readiness-item[data-state="error"] .admin-readiness-value { color: #b91c1c; }
    .admin-readiness-item[data-state="error"] .admin-readiness-icon { color: #dc2626; }
    .dark .admin-readiness-item[data-state="error"] .admin-readiness-value { color: #d49c9c; }
    .dark .admin-readiness-item[data-state="error"] .admin-readiness-icon { color: #d49c9c; }

    /* Darba zona: tabula + sakļaujams notikumu panelis */
    #adminWorkArea.admin-work-area { grid-template-columns: minmax(0, 1fr); }
    @media (min-width: 1024px) {
      #adminWorkArea.admin-work-area { grid-template-columns: minmax(0, 1fr) 340px; }
      #adminWorkArea.admin-work-area.events-collapsed { grid-template-columns: minmax(0, 1fr) 52px; }
    }
    .events-collapsed .events-panel > :not(.events-rail) { display: none !important; }
    .events-collapsed .events-panel { padding: 0.5rem 0.25rem; }
    .events-collapsed .events-rail { display: flex; }
    @media (max-width: 1023px) {
      .events-collapsed .events-panel { min-height: 0; }
    }
    .admin-scans-table { width: 100%; min-width: 1156px; table-layout: fixed; }
    .admin-scans-table.inventory-comparison { min-width: 1356px; }
    .admin-scans-table td, .admin-scans-table th { box-sizing: border-box; vertical-align: middle; }
    .admin-scans-table th { line-height: 1.2; }
    #scansTable.inventory-comparison thead th.inventory-count-column {
      background-color: rgba(16, 185, 129, 0.15);
      color: #047857;
    }
    #scansTable.inventory-comparison thead th.inventory-stock-column {
      background-color: rgba(14, 165, 233, 0.18);
      color: #0369a1;
    }
    #scansTable.inventory-comparison tbody td.inventory-count-column { background-color: rgba(16, 185, 129, 0.08); }
    #scansTable.inventory-comparison tbody td.inventory-stock-column { background-color: rgba(14, 165, 233, 0.1); }
    #scansTable.inventory-comparison tbody tr:hover td.inventory-count-column { background-color: rgba(16, 185, 129, 0.14); }
    #scansTable.inventory-comparison tbody tr:hover td.inventory-stock-column { background-color: rgba(14, 165, 233, 0.17); }
    .dark #scansTable.inventory-comparison thead th.inventory-count-column {
      background-color: rgba(95, 168, 138, 0.12);
      color: #8cc4ab;
    }
    .dark #scansTable.inventory-comparison thead th.inventory-stock-column {
      background-color: rgba(107, 147, 196, 0.13);
      color: #93b8d3;
    }
    .dark #scansTable.inventory-comparison tbody td.inventory-count-column { background-color: rgba(95, 168, 138, 0.06); }
    .dark #scansTable.inventory-comparison tbody td.inventory-stock-column { background-color: rgba(107, 147, 196, 0.07); }
    .dark #scansTable.inventory-comparison tbody tr:hover td.inventory-count-column { background-color: rgba(95, 168, 138, 0.11); }
    .dark #scansTable.inventory-comparison tbody tr:hover td.inventory-stock-column { background-color: rgba(107, 147, 196, 0.12); }
    #adminToolbar button,
    #adminToolbar input {
      height: 2rem;
    }
    #adminToolbar button {
      padding-left: 0.6rem;
      padding-right: 0.6rem;
    }
    #adminToolbar > div:first-child button {
      padding-top: 0.25rem;
      padding-bottom: 0.25rem;
    }
    @media (min-width: 1024px) and (min-height: 650px) {
      .admin-table-scroll { max-height: calc(100vh - 20rem) !important; min-height: 260px; }
    }
    .admin-kpi-grid { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.5rem; }
    .admin-kpi-card {
      display: flex;
      flex: 1 1 10rem;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      min-width: min(100%, 9rem);
      max-width: 12rem;
      min-height: 3.25rem;
    }
    .admin-kpi-card:not(.admin-kpi-progress-card) {
      flex-direction: column;
      align-items: flex-start;
      justify-content: center;
      gap: 0.15rem;
    }
    .admin-kpi-variance-card {
      flex-basis: 14rem;
      min-width: min(100%, 14rem);
      max-width: 14rem;
    }
    .admin-kpi-progress-card {
      flex: 1 1 15rem;
      flex-direction: column;
      align-items: stretch;
      justify-content: center;
      min-width: min(100%, 14rem);
      max-width: 18rem;
    }
    .admin-kpi-progress-track {
      height: 0.4rem;
      overflow: hidden;
      border-radius: 9999px;
      background: #e2e8f0;
    }
    .admin-kpi-progress-track > span {
      display: block;
      width: 0;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #10b981, #2dd4bf);
      transition: width 0.5s ease;
    }
    .dark .admin-kpi-progress-track { background: rgba(255, 255, 255, 0.08); }
    .admin-header-status-group { flex: 1 1 auto; max-width: 850px; }
    #toastContainer {
      position: fixed;
      top: auto;
      bottom: var(--admin-toast-bottom, 3.5rem);
      right: max(0.75rem, calc((100vw - 1720px) / 2 + 1.5rem));
      z-index: 60;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 0.5rem;
      width: min(22rem, calc(100vw - 1rem));
      max-height: min(42vh, 28rem);
      overflow-y: auto;
      overscroll-behavior: contain;
      padding: 0.25rem;
      pointer-events: none;
    }
    #toastContainer:empty { display: none; }
    #toastContainer > * { width: 100%; pointer-events: auto; }
    .admin-toast { min-width: 0; overflow: hidden; }
    .admin-toast-description {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      overflow: hidden;
      overflow-wrap: anywhere;
      line-height: 1.3;
    }
    .admin-toast-close { display: inline-flex; flex: none; align-items: center; justify-content: center; }
    .table-summary-trigger {
      box-sizing: border-box;
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      max-width: 100%;
      min-width: 0;
      min-height: 1.5rem;
      padding: 0.2rem 0.4rem;
      border: 1px solid;
      border-radius: 0.6rem;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      font-size: 10px;
      line-height: 1.2;
      text-align: left;
      vertical-align: middle;
      white-space: nowrap;
      overflow: hidden;
      cursor: pointer;
      transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
    }
    .table-summary-trigger--devices {
      border-color: #e2e8f0;
      background: #f8fafc;
      color: #334155;
    }
    .dark .table-summary-trigger--devices {
      border-color: rgba(255, 255, 255, 0.1);
      background: rgba(255, 255, 255, 0.04);
      color: #cbd5e1;
    }
    .table-summary-trigger:hover { border-color: #94a3b8; }
    .dark .table-summary-trigger:hover { border-color: rgba(255, 255, 255, 0.25); }
    .table-summary-trigger:focus-visible {
      outline: 2px solid #10b981;
      outline-offset: 2px;
    }
    .table-summary-trigger[aria-expanded="true"] { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2); }
    .table-summary-trigger__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .table-summary-trigger__chevron { display: inline-flex; flex: none; opacity: 0.65; }
    .table-summary-trigger--expanded { flex-wrap: wrap; white-space: normal; }
    .table-summary-popover {
      position: fixed;
      z-index: 200;
      box-sizing: border-box;
      width: min(22rem, calc(100vw - 1rem));
      max-height: min(18rem, calc(100vh - 1rem));
      overflow: auto;
      padding: 0.5rem;
      border: 1px solid #cbd5e1;
      border-radius: 0.85rem;
      background: #ffffff;
      color: #1e293b;
      box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
      font-size: 0.75rem;
      overscroll-behavior: contain;
    }
    .dark .table-summary-popover {
      border-color: rgba(255, 255, 255, 0.12);
      background: #181c23;
      color: #e2e8f0;
      box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
    }
    .table-summary-popover__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      padding: 0.15rem 0.25rem 0.5rem;
      border-bottom: 1px solid #e2e8f0;
    }
    .dark .table-summary-popover__header { border-color: rgba(255, 255, 255, 0.08); }
    .table-summary-popover__title {
      min-width: 0;
      color: #475569;
      font-size: 0.7rem;
      font-weight: 700;
    }
    .dark .table-summary-popover__title { color: #cbd5e1; }
    .table-summary-popover__close {
      display: inline-flex;
      flex: none;
      align-items: center;
      justify-content: center;
      width: 1.6rem;
      height: 1.6rem;
      border-radius: 0.5rem;
      color: #64748b;
    }
    .table-summary-popover__close:hover { background: #f1f5f9; color: #0f172a; }
    .dark .table-summary-popover__close { color: #94a3b8; }
    .dark .table-summary-popover__close:hover { background: rgba(255, 255, 255, 0.08); color: #f8fafc; }
    .table-summary-popover__list { padding-top: 0.25rem; }
    .table-summary-popover__row {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 0.75rem;
      padding: 0.45rem 0.4rem;
      overflow-wrap: anywhere;
    }
    .table-summary-popover__row + .table-summary-popover__row { border-top: 1px solid #f1f5f9; }
    .dark .table-summary-popover__row + .table-summary-popover__row { border-color: rgba(255, 255, 255, 0.06); }
    .table-summary-popover__label { min-width: 0; font-weight: 500; }
    .table-summary-popover__value { flex: none; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
    .table-summary-popover__detail { display: block; line-height: 1.45; }
    .phone-bridge-content { align-items: start; }
    .phone-device-column { border-left: 1px solid #e2e8f0; padding-left: 1.25rem; }
    .dark .phone-device-column { border-color: rgba(255, 255, 255, 0.08); }
    #deviceManagerList { max-height: min(48vh, 32rem); overflow-y: auto; padding-right: 0.25rem; }
    @media (max-width: 1023px) {
      .phone-device-column { border-left: 0; border-top: 1px solid #e2e8f0; padding-left: 0; padding-top: 1rem; }
      .dark .phone-device-column { border-color: rgba(255, 255, 255, 0.08); }
    }
    @media (max-width: 1199px) {
      header > div:first-child {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
      }
      header > div:first-child > div:first-child {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
      }
      .admin-header-status-group {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: none;
      }
      header > div:first-child > div:last-child {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
      }
    }
    .dark .admin-kpi-progress-track > span { background: linear-gradient(90deg, #4a9d7c, #5fa8a0); }
    .admin-kpi-card.hidden { display: none; }
    @media (max-width: 640px) {
      .admin-kpi-card { flex-grow: 1; }
      .admin-kpi-progress-card { flex-basis: 100%; max-width: none; }
    }
    @keyframes notification-attention {
      0%, 100% { transform: scale(1); }
      35% { transform: scale(1.22); }
      70% { transform: scale(0.96); }
    }
    .notification-attention { animation: notification-attention 0.8s ease-out 1; }
    @media (prefers-reduced-motion: reduce) {
      .notification-attention { animation: none !important; }
    }

    input[type=number]::-webkit-inner-spin-button,
    input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
    input[type=number] { -moz-appearance: textfield; appearance: textfield; }

    .qty-warning-100 {
      background-color: #fef3c7 !important;
      border-color: #f59e0b !important;
      color: #92400e !important;
      font-weight: 700 !important;
    }
    .dark .qty-warning-100 {
      background-color: rgba(201, 161, 92, 0.14) !important;
      border-color: rgba(201, 161, 92, 0.4) !important;
      color: #e3cb9a !important;
      font-weight: 700 !important;
    }

    .qty-warning-500 {
      background-color: #ffe4e6 !important;
      border-color: #f43f5e !important;
      color: #9f1239 !important;
      box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.35) !important;
      font-weight: 800 !important;
    }
    .dark .qty-warning-500 {
      background-color: rgba(196, 122, 122, 0.16) !important;
      border-color: rgba(196, 122, 122, 0.45) !important;
      color: #e6c4c4 !important;
      box-shadow: none !important;
      font-weight: 800 !important;
    }

    .glass-menu {
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-radius: 1.25rem;
    }
    .dark .glass-menu {
      background: #1c2028 !important;
      border: 1px solid rgba(255, 255, 255, 0.08) !important;
      box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5) !important;
      color: #dde2ea !important;
    }
    html:not(.dark) .glass-menu {
      background: rgba(255, 255, 255, 0.98) !important;
      border: 1px solid rgba(203, 213, 225, 0.9) !important;
      box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.15) !important;
      color: #0f172a !important;
    }
    html:not(.dark) .glass-menu button { color: #1e293b !important; }
    html:not(.dark) .glass-menu button:hover { background-color: #ecfdf5 !important; color: #047857 !important; }
    .dark .glass-menu button { color: #e2e8f0 !important; }
    .dark .glass-menu button:hover { background-color: rgba(95, 168, 138, 0.12) !important; color: #86bda6 !important; }

    /* Eleganti hover efekti tabulas rindām un interaktīvajiem elementiem */
    #scansTableBody tr {
      transition: background-color 0.15s ease, border-color 0.15s ease;
    }
    #scansTableBody tr:hover {
      background-color: rgba(16, 185, 129, 0.06) !important;
    }
    .dark #scansTableBody tr:hover {
      background-color: rgba(95, 168, 138, 0.08) !important;
    }

    button, [role="button"] {
      transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    }
    :is(button, input, select, [role="button"]):focus-visible {
      outline: 2px solid #10b981;
      outline-offset: 2px;
    }

    /* Kompaktais tabulas režīms */
    .table-compact th { padding-top: 0.35rem !important; padding-bottom: 0.35rem !important; }
    .table-compact td { padding-top: 0.2rem !important; padding-bottom: 0.2rem !important; font-size: 0.75rem !important; }
    .table-compact input { height: 1.65rem !important; font-size: 0.75rem !important; }

    @media (min-width: 1280px) and (min-height: 700px) {
      body.admin-page { height: 100vh; overflow: hidden; }
      main.admin-main { overflow: hidden; }
      main.admin-main > .admin-work-area { flex: 1 1 0%; overflow: hidden; }
      .admin-work-area > div { min-height: 0; }
      .admin-work-area > div:first-child > div { min-height: 0; max-height: none; }
    }

    /* Vienkāršais / eksperta režīms */
    html[data-ui-mode="simple"] .expert-only { display: none !important; }
    html[data-ui-mode="expert"] .simple-only { display: none !important; }
    html[data-ui-mode="simple"] #adminWorkArea.admin-work-area { grid-template-columns: minmax(0, 1fr); }
    #simpleStatusDot[data-state="good"] { background-color: #5fa88a; }
    #simpleStatusDot[data-state="warning"] { background-color: #c9a15c; }
    #simpleStatusDot[data-state="error"] { background-color: #c47a7a; }
