:root {
  --app-green: #10b981;
  --app-orange: #f27649;
  --primary: #f27649;
  --bg: #070e1d;
  --surface: #111827;
  --surface-low: #141b2b;
  --border: #1e293b;
  --outline: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  --sidebar-bg: #0c1322;
  --header-bg: rgba(12, 19, 34, 0.92);
  --main-bg-start: #070e1d;
  --main-bg-center: #070e1d;
  --main-bg-end: #070e1d;
  --text: #f8fafc;
  --muted: #94a3b8;
  --glass: #111827;
  --glass-border: #1f2937;
  --menu-bg: #141b2b;
  --menu-item-bg: transparent;
  --input-bg: #0f172a;
  --input-border: #334155;
  --chip-bg: #141b2b;
  --chip-border: #1e293b;
  --btn-secondary-bg: #141b2b;
  --table-header-bg: #0c1322;
  --panel-soft-bg: #0c1322;
  --panel-soft-border: #1e293b;
  --status-danger: #f87171;
  --status-warning: #fbbf24;
  --status-ok: #34d399;
  --status-neutral: #64748b;
}

body[data-theme="light"] {
  --bg: #f8f9ff;
  --surface: #ffffff;
  --surface-low: #eff4ff;
  --border: #d3e4fe;
  --outline: #8b7269;
  --shadow: 0 1px 8px rgba(11, 28, 48, 0.06);
  --sidebar-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.92);
  --main-bg-start: #f8f9ff;
  --main-bg-center: #f8f9ff;
  --main-bg-end: #f8f9ff;
  --text: #0b1c30;
  --muted: #57423b;
  --glass: #ffffff;
  --glass-border: #e5eeff;
  --menu-bg: #ffffff;
  --menu-item-bg: #eff4ff;
  --input-bg: #eff4ff;
  --input-border: #d3e4fe;
  --chip-bg: #eff4ff;
  --chip-border: #d3e4fe;
  --btn-secondary-bg: #ffffff;
  --table-header-bg: #eff4ff;
  --panel-soft-bg: #eff4ff;
  --panel-soft-border: #d3e4fe;
  --status-danger: #ba1a1a;
  --status-warning: #b45309;
  --status-ok: #067647;
  --status-neutral: #8b7269;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  overflow-x: hidden;
}

h1, h2, h3, .sidebar-brand-name, .superadmin-kpi-card strong {
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", sans-serif;
}

.bg-blur {
  display: none;
}

.bg-blur-a {
  top: 2rem;
  left: 2rem;
  background: var(--app-green);
}

.bg-blur-b {
  right: 3rem;
  bottom: 3rem;
  background: var(--app-orange);
}

.app-sidebar {
  display: none;
}

.app-frame {
  min-height: 100vh;
}

.topbar {
  position: relative;
  z-index: 30;
  margin: 1rem auto;
  width: min(1100px, 94vw);
  padding: 0.4rem 0.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.app-shell .app-sidebar {
  display: flex;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 288px;
  z-index: 50;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
}

body.app-shell .app-frame {
  padding-left: 288px;
}

body.app-shell .guest-brand {
  display: none;
}

body.app-shell .topbar {
  position: fixed;
  top: 0;
  left: 288px;
  right: 0;
  width: auto;
  height: 64px;
  margin: 0;
  padding: 0 1.5rem;
  justify-content: flex-end;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

body.app-shell #appView.container {
  width: auto;
  max-width: 1720px;
  margin: 0 auto;
  padding: 5.25rem 1.5rem 2rem;
}

body.app-shell #homePanel.app-main-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.sidebar-brand {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.75rem 1.25rem 0.65rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  height: 40px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
}

.sidebar-brand-sub {
  display: block;
  margin-top: 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-label {
  padding: 0.2rem 0.75rem 0.15rem;
  color: var(--outline);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-ico {
  font-family: "Material Symbols Outlined";
  font-weight: 500;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  width: 20px;
  height: 20px;
  overflow: hidden;
  flex: 0 0 20px;
}

.app-sidebar .nav-item.hidden,
.app-sidebar .menu-item.hidden,
.sidebar-group.hidden {
  display: none;
}

.app-sidebar .nav-item,
.app-sidebar .menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  height: auto;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}

.app-sidebar .nav-item:hover,
.app-sidebar .menu-item:hover {
  background: var(--surface-low);
  color: var(--text);
}

.app-sidebar .nav-item.active,
.app-sidebar .menu-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 16px rgba(242, 118, 73, 0.28);
}

@media (max-width: 960px) {
  body.app-shell .app-sidebar {
    width: 240px;
  }

  body.app-shell .app-frame,
  body.app-shell .topbar {
    padding-left: 0;
  }

  body.app-shell .app-frame {
    padding-left: 240px;
  }

  body.app-shell .topbar {
    left: 240px;
  }
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-copy h1 {
  margin: 0;
  font-size: 1rem;
}

.brand-copy p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.logo-inline {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.7);
  padding: 3px;
}

.toolbar-nav {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.nav-item {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border-radius: 10px;
  height: 32px;
  padding: 0 0.75rem;
  cursor: pointer;
  font-size: 0.78rem;
}

.nav-item.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.16);
}

.nav-dropdown,
.user-dropdown {
  position: relative;
  z-index: 40;
}

.menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  display: grid;
  gap: 0.2rem;
  background: var(--menu-bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0.35rem;
  z-index: 50;
}

.user-dropdown .menu {
  right: 0;
  left: auto;
  min-width: 160px;
}

.menu-item {
  height: 34px;
  border: none;
  border-radius: 8px;
  background: var(--menu-item-bg);
  color: var(--text);
  text-align: left;
  padding: 0 0.7rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.16);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.2rem;
}

.brand p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.7);
  padding: 4px;
}

.container {
  position: relative;
  z-index: 1;
  margin: 1rem auto 2rem;
  width: min(1100px, 94vw);
  display: grid;
  gap: 1rem;
}

#appView.container {
  width: 90vw;
  max-width: 90vw;
}

.app-main-card {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.login-layout {
  min-height: calc(100vh - 110px);
  align-items: center;
  grid-template-columns: 1.1fr 0.9fr;
}

.hero-copy {
  padding: 1rem;
}

.hero-copy h2 {
  margin: 0.7rem 0 0.6rem;
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.logo-hero {
  width: 70px;
  height: 70px;
  border-radius: 14px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.86);
  padding: 6px;
}

.role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.badge {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
}

.hidden {
  display: none;
}

.card, .kpi {
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.form-stack {
  grid-template-columns: 1fr;
}

.auth-steps {
  display: flex;
  gap: 0.5rem;
  margin: 0.7rem 0 0.9rem;
}

.auth-step {
  font-size: 0.74rem;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
}

.auth-step.active {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

label {
  display: grid;
  gap: 0.4rem;
}

input {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  padding: 0 0.7rem;
}

select {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  padding: 0 0.7rem;
}

textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  padding: 0.6rem 0.7rem;
  resize: vertical;
}

input.input-error {
  border-color: #FF8E9B;
}

.field-error {
  min-height: 14px;
  font-size: 0.75rem;
  color: #FF9C9C;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

.remember-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.remember-wrap input {
  width: 16px;
  height: 16px;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.84rem;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.btn {
  height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  padding: 0 0.9rem;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.btn.secondary {
  background: var(--btn-secondary-bg);
  border-color: var(--border);
  color: var(--text);
}

.chip {
  margin: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  color: var(--muted);
  background: var(--chip-bg);
  font-size: 0.8rem;
}

.chip-btn {
  cursor: default;
}

.btn:hover {
  filter: brightness(1.08);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.kpi h3 {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.kpi p {
  margin: 0.55rem 0 0;
  font-size: 0.95rem;
  word-break: break-word;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

#resultsPanel .btn {
  margin-top: 0.4rem;
}

.result-summary {
  margin: 0.9rem 0 0.5rem;
  font-size: 0.9rem;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.admin-grid {
  display: block;
}

.admin-grid form {
  max-width: 560px;
}

.admin-grid form.vendor-scope-form {
  max-width: 100%;
}

.vendor-scope-full {
  grid-column: 1 / -1;
}

.vendor-scope-toolbar {
  flex-wrap: wrap;
  align-items: flex-end;
}

.vendor-scope-filter-row {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.admin-switch {
  display: flex;
  gap: 0.5rem;
  margin: 0.7rem 0 1rem;
}

.theme-switch {
  display: flex;
  gap: 0.5rem;
  margin-top: 0;
}

.theme-switch .nav-item {
  border: 1px solid var(--border);
  background: var(--surface-low);
  color: var(--text);
  border-radius: 8px;
  height: 36px;
  min-width: 5.5rem;
  padding: 0 0.9rem;
  font-weight: 600;
}

.theme-switch .nav-item.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.icon-btn.hidden {
  display: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.icon-btn:hover {
  background: var(--surface-low);
}

.profile-prefs {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.profile-pref-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(100%, 28rem);
  justify-content: space-between;
}

.toolbar-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.toolbar-inline-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.faq-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0.4rem 0 0.75rem;
  flex-wrap: wrap;
}

.faq-tab {
  border: 1px solid color-mix(in srgb, var(--app-green, #41a58d) 45%, transparent);
  background: color-mix(in srgb, #ffffff 8%, transparent);
  color: inherit;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
  font: inherit;
}

.faq-tab.active {
  background: var(--app-green, #41a58d);
  border-color: var(--app-green, #41a58d);
  color: #fff;
}

.faq-topic-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.9rem;
  flex-wrap: wrap;
}

.faq-topic-tab {
  border: 1px solid color-mix(in srgb, var(--app-orange, #f27649) 40%, transparent);
  background: transparent;
  color: inherit;
  border-radius: 0.55rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
}

.faq-topic-tab.active {
  background: color-mix(in srgb, var(--app-orange, #f27649) 85%, #000);
  border-color: var(--app-orange, #f27649);
  color: #fff;
}

.admin-users-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-user-active-row {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.admin-user-active-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
}

.merchant-stores-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.merchant-store-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 14, 20, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 1rem;
  overflow-y: auto;
}

.merchant-store-modal.hidden {
  display: none;
}

.merchant-store-modal-card {
  width: min(1100px, 98vw);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  overflow-x: hidden;
}

.merchant-store-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.merchant-store-modal-head h3 {
  margin: 0;
}

.merchant-store-modal-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 0.75rem;
}

.merchant-store-modal label {
  gap: 0.25rem;
}

.merchant-store-modal label .muted {
  font-size: 0.82rem;
  line-height: 1.3;
}

.merchant-store-modal textarea {
  min-height: 120px;
  resize: vertical;
  width: 100%;
  font: inherit;
  padding: 0.45rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  background: color-mix(in srgb, #ffffff 8%, transparent);
  color: inherit;
}

.merchant-store-modal input,
.merchant-store-modal select {
  height: 34px;
}

.merchant-store-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  grid-column: 1 / -1;
}

.loyalty-form-period {
  grid-column: 1 / -1;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(65, 165, 141, 0.22);
  background: rgba(0, 0, 0, 0.2);
  margin: 0.15rem 0 0.35rem;
}

.loyalty-form-period-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 0.35rem 0;
  color: #e8f2ee;
  letter-spacing: 0.02em;
}

.loyalty-form-period-hint {
  margin: 0 0 0.85rem 0;
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 42rem;
}

.loyalty-form-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
}

@media (max-width: 700px) {
  .loyalty-form-date-grid {
    grid-template-columns: 1fr;
  }
}

.loyalty-form-date-block {
  min-width: 0;
}

.loyalty-form-date-block-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.loyalty-form-date-time-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 0.65rem;
  align-items: end;
}

.loyalty-form-inline-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  min-width: 0;
  font-size: 0.84rem;
}

.loyalty-form-inline-field > span {
  color: var(--muted);
  font-size: 0.8rem;
}

.loyalty-form-inline-field input[type="date"],
.loyalty-form-inline-field input[type="time"] {
  min-height: 38px;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.88rem;
}

.loyalty-target-merchant-block {
  margin-bottom: 0.35rem;
}

.loyalty-target-inline-toolbar {
  margin-bottom: 0.25rem;
}

.loyalty-selected-stores-summary {
  margin: 0;
  min-height: 1.1em;
}

.loyalty-store-picker-list {
  max-height: min(45vh, 360px);
  overflow-y: auto;
  margin: 0.5rem 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
}

.loyalty-store-picker-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
}

.loyalty-store-picker-row:last-child {
  border-bottom: none;
}

.loyalty-store-picker-row-check {
  cursor: pointer;
  margin: 0;
}

.loyalty-store-picker-row-disabled {
  flex-direction: column;
  gap: 0.15rem;
  opacity: 0.78;
}

.loyalty-store-picker-no-local {
  font-size: 0.8rem;
}

.superadmin-kpi-chart {
  width: 100%;
  height: 1.45cm;
  margin-top: 0.15rem;
  display: block;
}

#superAdminUsersPolyline {
  fill: none;
  stroke: #41A58D;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#superAdminInvoicesPolyline {
  fill: none;
  stroke: #F27649;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#merchantHomeStoresPolyline {
  fill: none;
  stroke: #41a58d;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#merchantHomeInvoicesPolyline {
  fill: none;
  stroke: #f27649;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.merchant-home-chart-hint {
  font-size: 0.55rem;
  margin: 0.12rem 0 0;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.role-client-home {
  width: 100%;
}

.role-client-home-heading h2 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.role-client-home-heading p.muted {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
}

.manufacturer-home-body {
  margin-top: 0.15rem;
}

.manufacturer-home-placeholder {
  height: auto;
  min-height: 4cm;
}

.manufacturer-home-placeholder h3 {
  font-size: 0.78rem;
  margin: 0 0 0.35rem;
}

.manufacturer-home-placeholder .muted {
  font-size: 0.68rem;
  line-height: 1.3;
}

.merchant-home-kpi-grid {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  align-items: stretch;
}

@media (max-width: 960px) {
  .merchant-home-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .merchant-home-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.superadmin-kpi-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}

#superAdminHomeKpiGrid.hidden {
  display: none;
}

.superadmin-kpi-card.glass-soft {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

.superadmin-kpi-card {
  min-height: 8.5rem;
  height: auto;
  padding: 0.85rem 0.9rem;
  overflow: visible;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.35rem;
}

.superadmin-kpi-card.superadmin-kpi-card--clickable,
#supportHomeKpiCard,
#superAdminInvoicesKpiCard,
#superAdminMerchantsKpiCard,
#superAdminArtikliKpiCard {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.superadmin-kpi-card.superadmin-kpi-card--clickable:hover,
#supportHomeKpiCard:hover,
#superAdminInvoicesKpiCard:hover,
#superAdminMerchantsKpiCard:hover,
#superAdminArtikliKpiCard:hover {
  border-color: rgba(65, 165, 141, 0.55);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.superadmin-kpi-card.superadmin-kpi-card--clickable:focus-visible,
#supportHomeKpiCard:focus-visible,
#superAdminInvoicesKpiCard:focus-visible,
#superAdminMerchantsKpiCard:focus-visible,
#superAdminArtikliKpiCard:focus-visible {
  outline: 2px solid var(--app-green, #41a58d);
  outline-offset: 2px;
}

.toolbar-inline.superadmin-kpi-head-wrap {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.superadmin-kpi-dual {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  text-align: left;
  font-size: 0.7rem;
}

.superadmin-kpi-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
}

.superadmin-kpi-stat span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.superadmin-kpi-stat strong {
  font-size: 0.88rem;
}

#merchantHomeActivityCard.merchant-home-activity-card {
  grid-column: span 1;
  height: 4cm;
  max-height: 4cm;
  min-height: 4cm;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.4rem 0.45rem;
}

.merchant-home-activity-card .toolbar-inline.superadmin-kpi-head-wrap {
  margin-bottom: 0.12rem;
  gap: 0.15rem;
}

.merchant-home-activity-card .toolbar-inline.superadmin-kpi-head-wrap h3 {
  font-size: 0.72rem;
  line-height: 1.15;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-home-activity-hint {
  font-size: 0.58rem;
  margin: 0 0 0.2rem;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.merchant-kpi-rows {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  margin-top: 0;
  flex: 0 0 auto;
}

.merchant-kpi-row {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  font-size: 0.68rem;
}

.merchant-kpi-row > span:first-child {
  color: var(--text-muted, #9aa0a6);
  font-size: 0.7rem;
}

#merchantHomeActivityCard .merchant-kpi-row > span:first-child {
  font-size: 0.55rem;
  line-height: 1.1;
}

.merchant-kpi-nums {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.28rem 0.45rem;
  font-size: 0.78rem;
}

#merchantHomeActivityCard .merchant-kpi-nums {
  gap: 0.12rem 0.28rem;
  font-size: 0.6rem;
}

.merchant-kpi-num-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
}

.merchant-kpi-num-wrap strong {
  font-size: 0.95rem;
  color: #41a58d;
}

#merchantHomeActivityCard .merchant-kpi-num-wrap strong {
  font-size: 0.72rem;
}

#merchantHomeActivityCard .superadmin-kpi-chart {
  width: 100%;
  height: 0.62cm;
  margin-top: 0.06rem;
  flex: 0 0 auto;
}

#merchantHomeActivityCard .merchant-home-chart-hint {
  -webkit-line-clamp: 1;
  margin: 0.1rem 0 0;
  font-size: 0.5rem;
}

.merchant-kpi-secondary-strong {
  color: #f27649;
}

.merchant-kpi-sep {
  user-select: none;
}

.artikli-og-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.artikli-og-suggest {
  min-height: 0;
}

.artikli-og-busy {
  margin: 0;
  font-size: 0.75rem;
}

.artikli-suggest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 9rem;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--panel-soft-border);
  background: var(--panel-soft-bg, rgba(20, 26, 34, 0.5));
}

.artikli-suggest-list:empty {
  display: none;
}

.artikli-suggest-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.35rem 0.5rem;
  border: none;
  border-bottom: 1px solid var(--panel-soft-border);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.artikli-suggest-list li:last-child button {
  border-bottom: none;
}

.artikli-suggest-list button:hover {
  background: rgba(65, 165, 141, 0.15);
}

.merchant-store-modal-form .span-2 {
  grid-column: 1 / -1;
}

.artikli-edit-fieldset {
  margin: 0;
  padding: 0.5rem 0.65rem 0.65rem;
  border: 1px solid var(--panel-soft-border);
  border-radius: 10px;
}

.artikli-edit-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  color: var(--muted, #8a9aaa);
}

.artikli-edit-budget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.artikli-edit-stablo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 720px) {
  .artikli-edit-stablo-grid {
    grid-template-columns: 1fr;
  }

  .artikli-edit-budget-grid {
    grid-template-columns: 1fr;
  }
}

.artikli-edit-fieldset select {
  width: 100%;
}

.artikli-edit-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.artikli-edit-modal-actions .btn {
  flex: 0 1 auto;
  min-width: 7rem;
}

.superadmin-kpi-card .toolbar-inline {
  margin-bottom: 0;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
}

.superadmin-kpi-card h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
  flex: 1 1 auto;
  min-width: 0;
}

.superadmin-kpi-card > .toolbar-inline > strong,
.superadmin-kpi-card .superadmin-kpi-value {
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  flex-shrink: 0;
}

.superadmin-kpi-card p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

.superadmin-kpi-card .superadmin-kpi-chart {
  flex: 1 1 auto;
  min-height: 2.2rem;
  max-height: 3.2rem;
  width: 100%;
  margin-top: auto;
}

.glass-soft {
  background: var(--panel-soft-bg);
  border: 1px solid var(--panel-soft-border);
  border-radius: 12px;
  padding: 0.8rem;
}

.role-panel h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.role-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.admin-grid h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.output {
  margin-top: 0.8rem;
  padding: 0.8rem;
  background: var(--panel-soft-bg);
  border-radius: 10px;
  min-height: 120px;
  overflow-x: auto;
  font-size: 0.78rem;
}

.table-wrap {
  width: 100%;
  margin: 0.6rem auto 0;
  overflow: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 680px;
}

.result-table th,
.result-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.result-table th {
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--table-header-bg);
}

.table-sort-btn {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.table-sort-btn.active {
  color: var(--text);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.table-pagination .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem;
}

.kv-item {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.55rem;
  background: rgba(0, 0, 0, 0.18);
}

.kv-key {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.kv-value {
  display: block;
  font-size: 0.86rem;
  word-break: break-word;
}

.status {
  min-height: 22px;
  margin: 0.7rem 0 0;
}

.status-ok {
  color: #70F0B8;
}

.status-err {
  color: #FF9C9C;
}

.app-status {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 2rem));
  margin: 0;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.app-status.hidden {
  display: none;
}

body[data-theme="light"] .app-status.status-ok {
  color: #067647;
}

body[data-theme="light"] .app-status.status-err {
  color: #b42318;
}

.app-user-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.app-user-head h2 {
  margin: 0 0 0.2rem;
}

.app-user-totals {
  display: flex;
  gap: 0.75rem;
}

.app-user-totals div,
.app-user-facts div,
.app-user-counts div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 9rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-low);
}

.app-user-totals span,
.app-user-facts span,
.app-user-counts span {
  color: var(--muted);
  font-size: 0.75rem;
}

.app-user-totals strong {
  font-size: 1.15rem;
}

.app-user-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0.2rem 0 0.8rem;
}

.app-user-tab {
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.app-user-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.app-user-facts,
.app-user-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.app-user-threads {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.app-user-threads li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.2rem;
  border-bottom: 1px solid var(--border);
}

.result-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.loyalty-section-gap {
  margin-top: 1rem;
}

.loyalty-filters-gap {
  margin: 0.75rem 0 1rem;
}

.muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 0.2rem 0.2rem 0.6rem;
  }

  .toolbar-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .menu {
    position: static;
    margin-top: 0.3rem;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-main-card {
    width: 100%;
  }

  .merchant-store-modal-form {
    grid-template-columns: 1fr;
  }

  .support-inbox-layout {
    grid-template-columns: 1fr;
  }

  .support-inbox-sidebar {
    max-height: 45vh;
  }
}

/* Support inbox (Budgetino app contact threads) */
.support-home-kpi > .toolbar-inline > strong,
#supportOpenThreadsValue {
  font-size: 2rem;
  color: var(--app-orange, #f27649);
}

.support-inbox-panel .support-inbox-intro {
  margin: 0 0 1rem;
}

.support-inbox-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  min-height: 62vh;
}

.support-inbox-sidebar,
.support-inbox-detail {
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 58vh;
}

.support-inbox-filters {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 0.5rem;
}

.support-thread-list {
  padding: 0.5rem;
  overflow: auto;
  flex: 1;
}

.support-thread-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 10px;
  padding: 0.65rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font: inherit;
}

.support-thread-active {
  border-color: var(--app-green, #41a58d);
  background: rgba(65, 165, 141, 0.12);
}

.support-thread-top,
.support-thread-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.support-thread-uid {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.support-thread-preview {
  margin: 0.35rem 0;
  font-size: 0.9rem;
}

.support-pill {
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.1rem 0.48rem;
}

.support-pill-open {
  background: rgba(65, 165, 141, 0.2);
  color: var(--app-green, #41a58d);
}

.support-pill-closed {
  background: rgba(156, 163, 175, 0.25);
  color: var(--muted);
}

.support-inbox-detail-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.support-detail-header {
  border-bottom: 1px solid var(--border);
  padding: 0.9rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.support-detail-title {
  margin: 0;
  font-size: 1.1rem;
}

.support-detail-meta {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
}

.support-close-btn {
  color: var(--danger, #c44);
}

.support-messages {
  padding: 0.9rem;
  display: grid;
  gap: 0.65rem;
  overflow: auto;
  flex: 1;
}

.support-msg {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.support-msg-support {
  background: rgba(65, 165, 141, 0.1);
  border-color: rgba(65, 165, 141, 0.35);
}

.support-msg-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
}

.support-msg-body {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.support-attachments {
  margin: 0.45rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.support-attach-thumb-btn {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  cursor: zoom-in;
  overflow: hidden;
  line-height: 0;
}

.support-attach-thumb {
  display: block;
  width: 5cm;
  height: 5cm;
  max-width: 100%;
  object-fit: cover;
}

.support-attach-file {
  font-size: 0.88rem;
  color: var(--muted);
  align-self: center;
}

.support-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(8, 12, 18, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 0.75rem;
}

.support-lightbox.hidden {
  display: none !important;
  pointer-events: none;
  visibility: hidden;
}

.support-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.support-lightbox-img {
  max-width: min(95vw, 1200px);
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.support-lightbox-caption {
  max-width: min(95vw, 900px);
  text-align: center;
  margin: 0;
}

body.support-lightbox-open {
  overflow: hidden;
}

.support-reply-box {
  border-top: 1px solid var(--border);
  padding: 0.75rem;
}

.support-textarea {
  width: 100%;
  resize: vertical;
  min-height: 90px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  padding: 0.6rem;
  font: inherit;
}

.support-reply-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.support-inbox-toast {
  margin: 0.5rem 0.9rem 0;
  font-size: 0.92rem;
  color: var(--app-green, #41a58d);
}

.support-inbox-toast-err {
  color: var(--danger, #c44);
}

.support-inbox-err {
  color: var(--danger, #c44);
  padding: 0.5rem 0.75rem;
  font-size: 0.92rem;
}

#homePanel:has(#homeSummary:not(.hidden)) {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

#homeSummary,
.page-head,
.page-head-row,
.section-block,
.kpi-card,
.attention-row,
.attention-ok {
  min-width: 0;
  max-width: 100%;
}

#homeSummary {
  max-width: 100%;
}

.page-head {
  margin: 0 0 24px;
  min-width: 0;
  max-width: 100%;
}

.page-title {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.page-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.page-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  min-width: 0;
  flex: 1 1 180px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.page-meta-sep {
  color: var(--outline);
}

.page-head-row .btn {
  margin-left: auto;
  flex: 0 0 auto;
}

.segment {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.segment button {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  padding: 6px 12px;
  cursor: pointer;
}

.segment button + button {
  border-left: 1px solid var(--border);
}

.segment button[aria-pressed="true"] {
  background: var(--surface-low);
  color: var(--text);
  font-weight: 600;
}

.segment button:focus-visible,
.kpi-card:focus-visible,
.attention-row:focus-visible,
.plain-table tbody tr:focus-visible,
.text-action:focus-visible {
  outline: 2px solid var(--outline);
  outline-offset: 2px;
}

.attention {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 24px;
}

.attention-title {
  margin: 0 0 4px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.attention-row,
.attention-ok {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  text-align: left;
}

.attention-row {
  cursor: pointer;
  border-left-color: var(--status-danger);
}

.attention-row:hover {
  background: var(--surface-low);
}

.attention-ok {
  margin-bottom: 24px;
  border-left-color: var(--status-ok);
}

.attention-row .nav-ico {
  color: var(--status-danger);
  flex: 0 0 auto;
}

.attention-ok .nav-ico {
  color: var(--status-ok);
  flex: 0 0 auto;
}

.attention-go {
  margin-left: auto;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}

.attention-go::after {
  content: " →";
}

.section-block {
  margin: 0 0 24px;
}

.section-title {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.section-note {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-left-color: var(--status-neutral);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}

.kpi-card:hover:not(.kpi-card-static) {
  background: var(--surface-low);
}

.kpi-card-static {
  cursor: default;
}

.kpi-card-wide {
  grid-column: span 3;
}

.kpi-card-danger {
  border-left-color: var(--status-danger);
}

.kpi-card-warn {
  border-left-color: var(--status-warning);
}

.kpi-card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.kpi-card-value,
.kpi-quad-value {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.kpi-card-value-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.kpi-card-context {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.kpi-quad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.kpi-quad-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.kpi-sparkline {
  width: 96px;
  height: 32px;
  flex: 0 0 96px;
}

.kpi-sparkline polyline {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

.plain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}

.plain-table-compact {
  width: 100%;
  max-width: 560px;
}

.plain-table th {
  padding: 8px 12px 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.plain-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: baseline;
}

.plain-table td.num,
.plain-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 0;
}

.plain-table tbody tr[data-open] {
  cursor: pointer;
}

.plain-table tbody tr[data-open]:hover td {
  background: var(--surface-low);
}

.text-action {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.text-action:hover {
  text-decoration: underline;
}

.link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

.merchant-card-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.merchant-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
}

.merchant-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 9rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-low);
  color: inherit;
  font: inherit;
  text-align: left;
}

button.merchant-stat {
  cursor: pointer;
}

button.merchant-stat:hover {
  border-color: var(--outline);
}

.merchant-stat span {
  color: var(--muted);
  font-size: 12px;
}

.merchant-stat strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.merchant-store-list {
  margin: 8px 0 0;
  padding-left: 1.1rem;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-card-wide {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  .page-head-row {
    align-items: flex-start;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-quad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-card-wide {
    grid-column: auto;
  }

  .kpi-quad-value {
    font-size: 20px;
  }
}

.notify-banner {
  margin: 0 0 16px;
  color: var(--status-warning, var(--warning));
}

.notify-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.notify-tab.active {
  border-color: var(--text);
}

.notify-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

.notify-form,
.notify-test,
.notify-user-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notify-actions {
  display: flex;
  gap: 8px;
}

.notify-check,
.notify-mandatory,
.support-notify-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notify-phone {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
}

.notify-phone-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.notify-phone-text {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.notify-result,
.notify-detail {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.notify-history-row {
  cursor: pointer;
}

.notify-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 30;
}

.notify-modal.hidden {
  display: none;
}

.notify-user-card {
  width: min(420px, calc(100% - 32px));
  padding: 16px;
}

@media (max-width: 800px) {
  .notify-layout {
    grid-template-columns: 1fr;
  }
}

