/* ==========================================================================
   HORECA OS — Enterprise Multi-Tenant SaaS Design System (v1.2.0)
   Light-First Default Palette (Rule 36) + 3-Mode Theme Switcher (Light/Dark/System)
   Mobile-First Responsive App-Shell (Sidebar + Topbar + 6 Workspace Tabs)
   ========================================================================== */

:root,
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --surface-muted: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-hover: #eff6ff;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent-primary: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-text: #1e40af;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --purple: #6d28d9;
  --purple-bg: #ede9fe;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

[data-theme="dark"],
.dark {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --surface-muted: #1e293b;
  --bg-sidebar: #0f172a;
  --bg-hover: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --border-subtle: #334155;
  --border-strong: #475569;
  --accent-primary: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: #1e3a8a;
  --accent-text: #bfdbfe;
  --success: #4ade80;
  --success-bg: #14532d;
  --warning: #fbbf24;
  --warning-bg: #78350f;
  --danger: #f87171;
  --danger-bg: #7f1d1d;
  --purple: #c4b5fd;
  --purple-bg: #4c1d95;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 16px -2px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  font-size: 14px;
}

/* ==========================================================================
   Enterprise App-Shell Layout (Auto-Collapsed Hover-Expand Sidebar)
   v2.9.9 — /design-taste-frontend & /ui-ux-pro-max
   ========================================================================== */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 1024px) {
  .app-shell {
    flex-direction: row;
    padding-left: 72px; /* Rezervētā vieta sakļautajai ikonjoslai, lai novērstu lēkāšanu */
  }
}

.sidebar {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 40;
}

@media (min-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    border-bottom: none;
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.04);
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease, padding 0.2s ease;
    padding: 0.85rem 0.6rem;
    z-index: 100;
  }

  /* Uzbraucot ar peli, sānjosla vienmērīgi atveras virs darba virsmas kā vieds panelis */
  .sidebar:hover {
    width: 275px;
    min-width: 275px;
    max-width: 275px;
    box-shadow: 12px 0 35px rgba(15, 23, 42, 0.18);
    padding: 0.85rem 0.85rem;
  }
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-text {
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease, max-width 0.2s ease;
}

@media (min-width: 1024px) {
  .brand-text {
    opacity: 0;
    max-width: 0;
    display: none;
    pointer-events: none;
  }
  .sidebar:hover .brand-text {
    opacity: 1;
    max-width: 200px;
    display: block;
    pointer-events: auto;
  }
}

.brand-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0.25rem 0 0.2rem 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.2s ease;
}

@media (min-width: 1024px) {
  .sidebar-section-label {
    opacity: 0;
    max-height: 0;
    margin: 0;
    display: none;
    pointer-events: none;
  }
  .sidebar:hover .sidebar-section-label {
    opacity: 1;
    max-height: 24px;
    margin: 0.25rem 0 0.2rem 0.4rem;
    display: block;
    pointer-events: auto;
  }
}

.sidebar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

@media (min-width: 1024px) {
  .sidebar-nav {
    flex-direction: column;
  }
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .nav-tab-btn {
    justify-content: center;
    padding: 0.6rem 0;
  }
  .sidebar:hover .nav-tab-btn {
    justify-content: flex-start;
    padding: 0.65rem 0.75rem;
    gap: 0.6rem;
  }
}

.nav-tab-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-tab-btn.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-primary);
  font-weight: 700;
}

.nav-tab-icon {
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  flex-shrink: 0;
}

.nav-tab-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.2s ease, max-width 0.2s ease;
}

@media (min-width: 1024px) {
  .nav-tab-text {
    opacity: 0;
    max-width: 0;
    display: none;
  }
  .sidebar:hover .nav-tab-text {
    opacity: 1;
    max-width: 160px;
    display: inline-block;
  }
}

.nav-tab-badge {
  font-size: 0.71rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  transition: opacity 0.2s ease, max-width 0.2s ease;
}

@media (min-width: 1024px) {
  .nav-tab-badge {
    opacity: 0;
    max-width: 0;
    display: none;
  }
  .sidebar:hover .nav-tab-badge {
    opacity: 1;
    max-width: 90px;
    display: inline-block;
  }
}

.nav-tab-btn.active .nav-tab-badge {
  background: var(--accent-primary);
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.76rem;
  color: var(--text-muted);
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.25s ease;
}

@media (min-width: 1024px) {
  .sidebar-footer {
    opacity: 0;
    max-height: 0;
    padding: 0;
    border-top: none;
    display: none;
    pointer-events: none;
  }
  .sidebar:hover .sidebar-footer {
    opacity: 1;
    max-height: 200px;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: block;
    pointer-events: auto;
  }
}

/* ==========================================================================
   Main Workspace & Topbar/* ==========================================================================
   Main Workspace & Topbar
   ========================================================================== */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.55rem 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
  position: sticky;
  top: 0;
  z-index: 15;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.location-select {
  padding: 0.34rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
}

.theme-switcher {
  display: inline-flex;
  gap: 0.25rem;
  background: var(--bg-tertiary);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.theme-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.theme-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
}

.workspace-content {
  padding: 1.25rem;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   Executive 5-KPI Summary Strip
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-left: 4px solid var(--accent-primary);
}

.kpi-card.kpi-success {
  border-left-color: var(--success);
}

.kpi-card.kpi-warning {
  border-left-color: var(--warning);
}

.kpi-card.kpi-purple {
  border-left-color: var(--purple);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

/* ==========================================================================
   Tab Panels & Cards
   ========================================================================== */
.tab-panel {
  display: none;
  content-visibility: auto;
}

.tab-panel.active {
  display: block;
  content-visibility: visible;
}

.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.15rem;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  margin: 0.15rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Toolbars, Buttons, Badges & Search Inputs
   ========================================================================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--bg-tertiary);
}

.btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-pill {
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

.btn-pill.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.search-input {
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.84rem;
  min-width: 240px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.badge-purple {
  background: var(--purple-bg);
  color: var(--purple);
}

/* ==========================================================================
   Loyalty Master-Detail Workspace (Folder Tree + Cards + 8-Wallet Inspector)
   ========================================================================== */
.loyalty-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 1100px) {
  .loyalty-workspace {
    grid-template-columns: 270px 1fr;
  }
}

.folder-tree {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.folder-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.folder-btn:hover {
  border-color: var(--accent-primary);
}

.folder-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-primary);
  color: var(--accent-text);
}

.folder-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.inspector-banner {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.inspector-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.wallets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 0.65rem;
}

.wallet-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  transition: border-color 0.15s ease;
}

.wallet-card.wallet-positive {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

.wallet-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.wallet-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0.15rem 0;
}

.wallet-balance {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.wallet-rule {
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* ==========================================================================
   2D Visual Restaurant FloorPlan Canvas (Table12)
   ========================================================================== */
.floorplan-canvas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  padding: 1.1rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.fp-table-node {
  background: var(--bg-primary);
  border: 2px solid var(--success);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.fp-table-node:hover {
  transform: translateY(-2px);
}

.fp-table-node.fp-round {
  border-radius: 22px;
}

.fp-table-node.fp-vip {
  border-color: var(--purple);
  background: var(--bg-hover);
}

.fp-table-node.fp-reserved {
  border-color: var(--warning);
}

/* ==========================================================================
   Sortable Data Tables (Rule 37)
   ========================================================================== */
.table-scroll {
  overflow-x: auto;
  max-height: 540px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

table[data-sortable="true"] {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table[data-sortable="true"] th,
table[data-sortable="true"] td {
  padding: 0.62rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

table[data-sortable="true"] th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
}

table[data-sortable="true"] tbody tr:hover {
  background: var(--bg-hover);
}

table[data-sortable="true"] tbody tr.selected-row {
  background: var(--accent-soft);
}

.sort-indicator {
  display: inline-block;
  margin-left: 0.3rem;
  color: var(--accent-primary);
  font-size: 0.78rem;
}

.num-col {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ==========================================================================
   Password Field Visibility Toggle ("Actiņa" — Rule 38) & Toast
   ========================================================================== */
.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.password-field-wrapper input[type="password"],
.password-field-wrapper input[type="text"] {
  width: 100%;
  height: 36px;
  padding: 0.42rem 2.35rem 0.42rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.83rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.4rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.toast-notification {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 100;
  display: none;
}

.toast-notification.visible {
  display: block;
}

/* ==========================================================================
   v2.0.0 Multi-Tenant SaaS Hierarchy Tree, Compact Switcher & Modern Forms
   ========================================================================== */
.saas-holding-banner {
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-secondary));
  border: 1.5px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.saas-holding-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.saas-holding-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.saas-tree-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.15rem;
}

.saas-sia-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-top: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.saas-sia-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.saas-sia-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.saas-sia-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.saas-loc-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.saas-loc-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
}

.saas-loc-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.saas-loc-meta {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 0.12rem;
}

.saas-wh-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.38rem;
}

.saas-wh-pill {
  font-size: 0.71rem;
  font-weight: 600;
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* Segmented Form Switcher Toolbar (v2.0.0 Compact Drawer Mode) */
.compact-form-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.compact-form-switcher-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.form-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.form-switcher-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.form-switcher-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.crud-forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

.crud-forms-grid.crud-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

.crud-forms-grid.tabbed-mode {
  display: block;
}

.crud-forms-grid.tabbed-mode > .crud-form-card {
  display: none;
  margin-bottom: 0;
}

.crud-forms-grid.tabbed-mode > .crud-form-card.active-form-panel {
  display: block;
  border-left: 4px solid var(--accent-primary);
}

.crud-form-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  box-shadow: var(--shadow-sm);
}

.crud-form-card h3,
.crud-form-title {
  margin: 0 0 0.25rem 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.crud-form-subtitle {
  margin: 0 0 0.75rem 0;
  font-size: 0.77rem;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem 0.95rem;
  align-items: stretch;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.65rem 0.95rem;
  align-items: stretch;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 0.65rem 0.85rem;
  align-items: stretch;
}

.form-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.26rem;
  margin-bottom: 0.45rem;
  min-width: 0;
}

.form-group label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.25;
}

.form-control {
  height: 36px;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.83rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.form-control {
  height: auto;
  min-height: 64px;
}

.form-control:focus,
.password-field-wrapper input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-color);
}

/* v2.0.0 Modern Settings Architecture (Security / 2FA vs Operational Thresholds) */
.settings-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 0.95rem;
  margin-top: 0.5rem;
}

.settings-subcard {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.05rem;
}

.settings-subcard-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 0.65rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.settings-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.settings-toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.settings-toggle-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

.settings-toggle-card input[type="checkbox"] {
  margin-top: 0.15rem;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  flex-shrink: 0;
}

.settings-toggle-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.settings-toggle-card-desc {
  font-size: 0.71rem;
  color: var(--text-muted);
  margin-top: 0.12rem;
  line-height: 1.25;
}

.collapsible-drawer {
  display: none;
  background: var(--bg-secondary);
  border: 1.5px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.collapsible-drawer.open {
  display: block;
}

/* ==========================================================================
   v1.7.0 Full-Screen Login Gate Overlay & Role Switcher
   ========================================================================== */
body.auth-locked {
  overflow: hidden;
}

body.auth-locked .app-shell {
  pointer-events: none;
  user-select: none;
  opacity: 0.35;
}

/* Modern High-Agency Enterprise Login Gate (v2.9.9) */
.auth-login-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-login-gate.hidden {
  display: none !important;
}

.login-gate-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 2.25rem 2rem;
  position: relative;
  overflow: hidden;
}

.login-gate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #ec4899);
}

.login-gate-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.login-gate-brand-logo {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
  flex-shrink: 0;
}

.login-gate-header-text {
  flex: 1;
}

.login-gate-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.login-gate-subtitle {
  margin: 0.15rem 0 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.login-gate-intro {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 1.35rem;
  line-height: 1.45;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.login-input-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 1rem;
  pointer-events: none;
  color: var(--text-muted);
  z-index: 2;
}

.login-input-control {
  width: 100%;
  padding: 0.75rem 0.95rem 0.75rem 2.45rem !important;
  border-radius: 0.65rem !important;
  border: 1px solid var(--border-color) !important;
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  font-size: 0.92rem !important;
  font-weight: 500 !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease !important;
}

.login-input-control:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
  background: var(--bg-primary) !important;
}

.login-gate-card .password-field-wrapper .password-toggle-btn {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  z-index: 2;
  border-radius: 4px;
}

.login-gate-error {
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.9rem;
  border-radius: 0.5rem;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}

.btn-login-gate-submit {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: 0.65rem;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  margin-top: 0.5rem;
}

.btn-login-gate-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px -5px rgba(37, 99, 235, 0.5);
}

.btn-login-gate-submit:active {
  transform: translateY(0);
}

.login-gate-security-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.login-gate-divider {
  margin: 1.1rem 0 0.65rem 0;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.quick-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 0.5rem;
}

.quick-role-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.quick-role-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.quick-role-btn strong {
  font-size: 0.8rem;
  color: var(--text-primary);
}

.quick-role-btn span {
  font-size: 0.71rem;
  color: var(--text-secondary);
}

.quick-role-btn.role-superadmin {
  border-left: 4px solid #7c3aed;
}

.quick-role-btn.role-owner {
  border-left: 4px solid var(--accent-primary);
}

.quick-role-btn.role-tenantadmin {
  border-left: 4px solid var(--success);
}

/* ==========================================================================
   v2.1.0: Ctrl+K Command Palette & Kompakto Tabulu Blīvuma Pārslēdzējs
   ========================================================================== */
.cmd-palette-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cmd-palette-trigger-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: var(--bg-primary);
}

.cmd-kbd-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.38rem;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
}

.density-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.density-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.24rem 0.52rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.density-btn.active {
  background: var(--bg-primary);
  color: var(--accent-text);
  box-shadow: var(--shadow-sm);
}

.table-density-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.table-density-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.71rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.table-density-mini-btn:hover,
.table-density-mini-btn.active {
  border-color: var(--accent-primary);
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* Kompaktais tabulu blīvuma režīms (>50 kases transakciju vai preču skatam bez ritināšanas) */
html[data-table-density="compact"] table th,
table.compact-density th {
  padding: 0.28rem 0.48rem !important;
  font-size: 0.71rem !important;
  line-height: 1.15 !important;
}

html[data-table-density="compact"] table td,
table.compact-density td {
  padding: 0.22rem 0.48rem !important;
  font-size: 0.74rem !important;
  line-height: 1.18 !important;
}

html[data-table-density="compact"] table td .btn,
table.compact-density td .btn {
  padding: 0.14rem 0.42rem !important;
  font-size: 0.69rem !important;
}

html[data-table-density="compact"] table td .badge,
table.compact-density td .badge {
  padding: 0.1rem 0.4rem !important;
  font-size: 0.68rem !important;
}

html[data-table-density="compact"] .table-scroll {
  max-height: 760px;
}

/* Ctrl+K Command Palette Modālais Logs */
.command-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 9850;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 7vh 1rem 2rem 1rem;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
}

.command-palette-overlay.open {
  display: flex;
}

.command-palette-dialog {
  width: 100%;
  max-width: 720px;
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.command-palette-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.command-palette-search-icon {
  font-size: 1.1rem;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.command-palette-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.96rem;
  font-weight: 600;
  outline: none;
}

.command-palette-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.command-palette-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.command-palette-filter-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.command-palette-filter-btn:hover,
.command-palette-filter-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.command-palette-results {
  max-height: 410px;
  overflow-y: auto;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.command-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.1s ease;
}

.command-palette-item:hover,
.command-palette-item.selected {
  background: var(--accent-soft);
  border-color: var(--accent-primary);
}

.command-palette-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.command-palette-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.command-palette-item-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-palette-item-subtitle {
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-palette-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 0.73rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   v2.2.0 Ātrās Darbības (Quick Actions `>`) & Saglabātie Tabulu Skati (Saved Views)
   ========================================================================== */
.saved-views-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.saved-views-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
}

.saved-views-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-right: 0.2rem;
  white-space: nowrap;
}

.saved-view-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.saved-view-pill:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: var(--accent-soft);
}

.saved-view-pill.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.28);
}

.saved-view-pill .saved-view-count {
  font-size: 0.68rem;
  padding: 0.05rem 0.38rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
  font-weight: 700;
}

.saved-view-pill.active .saved-view-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.saved-view-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.15rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: 0.68rem;
  line-height: 1;
  opacity: 0.75;
}

.saved-view-delete-btn:hover {
  opacity: 1;
  background: rgba(220, 38, 38, 0.2);
}

.saved-view-creator-box {
  display: none;
  width: 100%;
  margin-top: 0.45rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-strong);
}

.saved-view-creator-box.open {
  display: block;
}

.command-palette-item[data-cmd-category="ACTIONS"] .command-palette-item-icon {
  background: var(--accent-soft);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
}

/* ==========================================================================
   v2.4.0 — Kompakta Galvene (.topbar), Neaplaužamas Nozīmītes (.nav-tab-badge),
            SaaS Tabulu Kodu Neatdalīšana, Hierarhiskais Karšu Koks (Cards Tree Explorer)
            un RFM Viesu Segmentācija & Reaktivācija
   ========================================================================== */
.nav-tab-btn > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-tab-badge {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  font-size: 0.68rem;
  padding: 0.12rem 0.44rem;
  line-height: 1.25;
}

.topbar {
  padding: 0.42rem 1rem;
  gap: 0.4rem 0.65rem;
  z-index: 35;
}

.topbar-left {
  gap: 0.45rem;
  flex: 1 1 auto;
}

.topbar-title {
  font-size: 0.88rem;
  max-width: 240px;
}

@media (max-width: 1560px) {
  .topbar-title {
    display: none;
  }
}

.location-select {
  padding: 0.26rem 0.52rem;
  font-size: 0.76rem;
  max-width: 265px;
  text-overflow: ellipsis;
}

.topbar .toolbar {
  gap: 0.35rem;
  flex-wrap: wrap;
}

.topbar .cmd-palette-trigger-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
}

.topbar .density-btn,
.topbar .theme-btn {
  padding: 0.22rem 0.48rem;
  font-size: 0.74rem;
  white-space: nowrap;
}

.card,
.crud-form-card,
.collapsible-drawer,
form[data-api-form="true"] {
  scroll-margin-top: 5.5rem;
}

td code {
  white-space: nowrap;
}

#table-saas-tenants td,
#table-saas-legal-entities td {
  vertical-align: middle;
}

/* Hierarhiskais Karšu Mapju Koks (Cards Tree Explorer no folders.csv / CARDS.dbf) */
.cards-tree-explorer-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cards-tree-summary-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.38rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.cards-tree-kpi-mini {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.5rem;
}

.cards-tree-kpi-mini-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cards-tree-kpi-mini-val {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 1px;
}

.tree-category-group {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  overflow: hidden;
}

.tree-category-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.42rem 0.58rem;
  background: var(--surface-muted);
  border: none;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.tree-category-header:hover {
  background: var(--bg-tertiary);
}

.tree-category-children {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.35rem;
}

.tree-category-group.collapsed .tree-category-children {
  display: none;
}

.folder-tree-node-btn {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  width: 100%;
  text-align: left;
  padding: 0.42rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.14s ease;
}

.folder-tree-node-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

.folder-tree-node-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-primary);
  box-shadow: inset 3px 0 0 var(--accent-primary);
}

.folder-tree-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.folder-tree-node-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  font-size: 0.69rem;
  color: var(--text-secondary);
}

/* RFM (Recency, Frequency, Monetary) Segmentācijas Kartītes */
.rfm-segments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.rfm-segment-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.rfm-segment-card:hover,
.rfm-segment-card.active {
  border-color: var(--accent-primary);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.rfm-segment-card.rfm-dormant-card {
  border-left: 4px solid #d97706;
}

.rfm-segment-card.rfm-champion-card {
  border-left: 4px solid #7c3aed;
}

.rfm-segment-card.rfm-loyal-card {
  border-left: 4px solid #059669;
}

.rfm-segment-card.rfm-new-card {
  border-left: 4px solid #0284c7;
}

/* ==========================================================================
   v2.8.6 — Settings & Integrations 5-Sub-Tab Control Center (/ui-ux-pro-max & /design-taste-frontend)
   ========================================================================== */
.settings-control-center-banner {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.settings-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.settings-overview-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.78rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-overview-card:hover {
  border-color: var(--accent-primary);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.settings-overview-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.settings-overview-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.settings-overview-card-desc {
  font-size: 0.73rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.settings-subtabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  margin-bottom: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  position: sticky;
  top: 0.5rem;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.settings-subtabs-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.settings-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.46rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.settings-subtab-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

.settings-subtab-btn.active {
  color: #ffffff;
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}

.settings-subpanel {
  animation: settingsFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes settingsFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  padding: 0.85rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.settings-step-card {
  background: var(--bg-primary);
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.settings-danger-zone {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(220, 38, 38, 0.05);
  border: 1px solid rgba(220, 38, 38, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   v2.9.0 /ui-ux-designer SaaS Guided Chain Workflow (1 ➔ 2 ➔ 3 ➔ 4 ➔ 5)
   ========================================================================== */
.saas-chain-breadcrumb-bar {
  background: linear-gradient(135deg, var(--bg-secondary), var(--accent-soft));
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.saas-chain-breadcrumb-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
}

.saas-chain-bc-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-right: 0.2rem;
}

.saas-chain-bc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.saas-chain-bc-pill:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.saas-chain-bc-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
}

.saas-chain-bc-arrow {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.saas-chain-status-msg {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.35rem 0.6rem;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.saas-chain-status-msg.saas-chain-status-highlight {
  border-color: var(--success);
  background: rgba(22, 163, 74, 0.08);
  color: var(--text-primary);
  font-weight: 600;
}

.step-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent-primary);
  font-size: 0.72rem;
  font-weight: 800;
}

.form-switcher-btn.active .step-num-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.step-arrow-hint {
  opacity: 0.65;
  font-size: 0.72rem;
  margin-left: 0.15rem;
}

.saas-express-step-btn {
  border-color: #7c3aed;
  color: #7c3aed;
  font-weight: 700;
}

.saas-express-step-btn.active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #ffffff;
}

.saas-express-chain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.saas-express-step-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.saas-express-step-header {
  font-size: 0.81rem;
  font-weight: 800;
  color: var(--text-primary);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}

.saas-loc-empty-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: var(--bg-primary);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.saas-wh-pill-add {
  cursor: pointer;
  border-style: dashed;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-primary);
}

.saas-wh-pill-add:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.active-tenant-row {
  background: rgba(37, 99, 235, 0.05);
}

/* ==========================================================================
   v2.9.1: OpenStreetMap / Leaflet Adrešu Autocomplete, Karte & RK7 DB Sasaiste
   ========================================================================== */
.geo-autocomplete-wrapper {
  position: relative;
}

.geo-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 1200;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18);
  max-height: 265px;
  overflow-y: auto;
}

.geo-suggestion-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.52rem 0.72rem;
  border: none;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.79rem;
  transition: background 0.12s ease;
}

.geo-suggestion-item:last-child {
  border-bottom: none;
}

.geo-suggestion-item:hover,
.geo-suggestion-item:focus {
  background: rgba(37, 99, 235, 0.09);
  outline: none;
}

.geo-suggestion-main {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.geo-suggestion-title {
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.geo-suggestion-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.geo-suggestion-coords {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-weight: 700;
  flex-shrink: 0;
}

[data-theme="dark"] .geo-suggestion-coords {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}

.gps-autofill-flash {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.22) !important;
  transition: all 0.25s ease;
}

.btn-inline-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-primary);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.btn-inline-link:hover {
  opacity: 0.85;
}

.osm-map-preview-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
}

.osm-map-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.rk7-mapping-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-left: 4px solid #2563eb;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
}

.rk7-mapping-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rk7-explainer-details {
  margin-top: 0.65rem;
  padding: 0.65rem 0.8rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--accent-primary);
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   v2.9.4: Table12 Galdu Rezervāciju Suite (1:1 ar darbinieku_registracija_qr)
   ========================================================================== */
.t12-suite-shell {
  padding: 1.5rem 1.75rem;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  margin-bottom: 1.35rem;
}

.t12-suite-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
}

.t12-suite-header-left {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.t12-suite-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.t12-suite-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.t12-suite-title {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.t12-suite-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.t12-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.t12-pill-amber {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.t12-pill-emerald {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.t12-pill-blue {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}

.t12-pill-purple {
  background: rgba(124, 58, 237, 0.14);
  color: #6d28d9;
}

[data-theme="dark"] .t12-pill-amber {
  color: #fbbf24;
}
[data-theme="dark"] .t12-pill-emerald {
  color: #34d399;
}
[data-theme="dark"] .t12-pill-blue {
  color: #60a5fa;
}
[data-theme="dark"] .t12-pill-purple {
  color: #c4b5fd;
}

.t12-suite-header-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.t12-header-obj-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
}

.t12-header-obj-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.t12-header-obj-select {
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}

.t12-btn-purple {
  background: #7c3aed !important;
  color: #ffffff !important;
  border: 1px solid #6d28d9 !important;
  border-radius: 11px !important;
  font-weight: 700 !important;
  padding: 0.48rem 0.95rem !important;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.22);
  transition: all 0.15s ease;
}

.t12-btn-purple:hover {
  background: #6d28d9 !important;
  transform: translateY(-1px);
}

.t12-btn-rose {
  background: rgba(244, 63, 94, 0.1) !important;
  color: #e11d48 !important;
  border: 1px solid rgba(244, 63, 94, 0.25) !important;
  border-radius: 11px !important;
  font-weight: 700 !important;
  padding: 0.48rem 0.85rem !important;
}

.t12-btn-rose:hover {
  background: rgba(244, 63, 94, 0.18) !important;
}

.t12-btn-outline {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 11px !important;
  font-weight: 600 !important;
  padding: 0.48rem 0.9rem !important;
}

.t12-btn-purple-outline {
  background: transparent !important;
  color: #7c3aed !important;
  border: 1.5px solid #8b5cf6 !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  padding: 0.65rem 1.1rem !important;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}

.t12-btn-purple-outline:hover {
  background: rgba(124, 58, 237, 0.08) !important;
}

.t12-suite-objects-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border-subtle);
}

.t12-objects-strip-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.t12-objects-strip-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.t12-obj-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.34rem 0.78rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.t12-obj-pill:hover {
  border-color: #8b5cf6;
}

.t12-obj-pill.active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.t12-obj-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
}

.t12-obj-dot.on {
  background: #10b981;
}

.t12-obj-pill.active .t12-obj-dot.on {
  background: #6ee7b7;
}

.t12-suite-subtabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.85rem 0 1.25rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.t12-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.95rem;
  border-radius: 11px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.t12-subtab-btn:hover {
  color: var(--text-primary);
  border-color: #8b5cf6;
}

.t12-subtab-btn.active,
.t12-subtab-btn.btn-primary {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.26);
}

.t12-oauth-grid-1to1 {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 1.35rem;
  align-items: stretch;
}

@media (max-width: 1180px) {
  .t12-oauth-grid-1to1 {
    grid-template-columns: 1fr;
  }
}

.t12-two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 1100px) {
  .t12-two-col-grid {
    grid-template-columns: 1fr;
  }
}

.t12-panel-card {
  padding: 1.4rem 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.02);
}

.t12-panel-card-header,
.t12-oauth-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.t12-panel-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.t12-panel-card-sub {
  margin: 0.25rem 0 0 0;
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.t12-enabled-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}

.t12-enabled-toggle-pill input[type="checkbox"] {
  accent-color: #7c3aed;
  width: 15px;
  height: 15px;
}

.t12-oauth-pkce-box {
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid rgba(139, 92, 246, 0.28);
  background: rgba(139, 92, 246, 0.05);
}

.t12-oauth-pkce-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.t12-oauth-pkce-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(139, 92, 246, 0.2);
}

.t12-venue-picker-select {
  padding: 0.36rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.t12-wp-compat-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.95rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.t12-2d-hallplan-card {
  padding: 1.15rem 1.35rem;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

.t12-2d-table-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 72px;
  padding: 0.35rem 0.55rem;
  border-radius: 11px;
  background: #ffffff;
  border: 2px solid #10b981;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  user-select: none;
}

[data-theme="dark"] .t12-2d-table-node {
  background: #1e293b;
}

.t12-2d-table-node:hover {
  transform: translate(-50%, -50%) scale(1.07);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.22);
  z-index: 5;
}

.t12-2d-table-node.round {
  border-radius: 999px;
}

.t12-2d-table-node.inactive {
  border-color: #94a3b8;
  opacity: 0.65;
}

/* ==========================================================================
   v2.9.5 — Ātrā Sākuma Vednis (Quick-Start Onboarding Wizard) &
            Tiešais 13 Integrāciju Savienojuma Indikators Galvenē (.topbar-integrations-pill)
   ========================================================================== */
.topbar-integrations-widget {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.topbar-integrations-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.26rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.topbar-integrations-pill:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.14);
}

.topbar-integrations-pill.all-green {
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.08);
  color: #15803d;
}

[data-theme="dark"] .topbar-integrations-pill.all-green {
  color: #4ade80;
  background: rgba(22, 163, 74, 0.16);
}

.topbar-integrations-pill.has-active {
  border-color: rgba(22, 163, 74, 0.38);
  background: rgba(22, 163, 74, 0.06);
}

.live-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.22);
  flex-shrink: 0;
}

.topbar-integrations-pill.none-active .live-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.topbar-integrations-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 460px;
  max-width: 92vw;
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
  z-index: 120;
  overflow: hidden;
}

.topbar-int-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.95rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.topbar-int-popover-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
}

.topbar-int-popover-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.topbar-int-popover-list {
  max-height: 310px;
  overflow-y: auto;
  padding: 0.45rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.topbar-int-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.topbar-int-row-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.topbar-int-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.topbar-int-dot.green {
  background: #16a34a;
}

.topbar-int-dot.amber {
  background: #d97706;
}

.topbar-int-dot.gray {
  background: #94a3b8;
}

.topbar-int-meta {
  min-width: 0;
}

.topbar-int-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-int-sub {
  font-size: 0.68rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-int-row-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.topbar-int-ping-btn {
  padding: 0.14rem 0.42rem !important;
  font-size: 0.68rem !important;
}

.topbar-int-core-tag {
  font-size: 0.67rem;
  color: var(--text-muted);
  font-weight: 600;
}

.topbar-int-popover-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.65rem 0.95rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

/* Quick-Start Onboarding Wizard (#tab-saas) */
.quickstart-wizard-card {
  margin: 0.75rem 0 0.9rem 0;
  padding: 0.85rem 1.05rem;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.32);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.quickstart-wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.quickstart-wizard-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}

.quickstart-wizard-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.12rem;
}

.quickstart-wizard-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.quickstart-post-save-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
}

.quickstart-post-save-bar.quickstart-post-save-highlight {
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.14);
}

.quickstart-post-save-text {
  font-size: 0.78rem;
  color: var(--text-primary);
}

.quickstart-post-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}










