:root {
  --bg: #0e1414;
  --bg-spot: #1a2525;
  --panel: #111c1c;
  --panel-2: #162525;
  --panel-bg: linear-gradient(160deg, rgba(17, 28, 28, 0.96), rgba(10, 18, 18, 0.96));
  --panel-border: rgba(255, 255, 255, 0.07);
  --hero-bg: linear-gradient(145deg, rgba(20, 34, 34, 0.95), rgba(10, 18, 18, 0.95));
  --tabs-bg: rgba(10, 18, 18, 0.85);
  --tab-bg: rgba(255, 255, 255, 0.04);
  --tab-border: rgba(255, 255, 255, 0.15);
  --ghost-border: rgba(255, 255, 255, 0.18);
  --accent: #f4b942;
  --accent-2: #3dd6c6;
  --text: #e9f1f1;
  --muted: #a8b5b5;
  --danger: #f46f5d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --hero-height: 160px;
  --hero-height-expanded: 160px;
  --hero-height-collapsed: var(--tabs-height);
  --tabs-height: 60px;
  --fixed-gap: 10px;
  --content-width: 980px;
  --content-width-wide: 1180px;
}

[hidden] {
  display: none !important;
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% 10%, var(--bg-spot) 0%, var(--bg) 50%)
    fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  margin: 0 0 0.4rem;
}

p {
  margin: 0;
}

.app {
  max-width: 100%;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  gap: 28px;
}

.app > .hero,
.app > .tabs-fixed,
.app > .panel {
  width: min(100%, var(--content-width));
  margin-left: auto;
  margin-right: auto;
}

#reports-panel {
  width: min(100%, var(--content-width-wide));
}

.hero {
  position: relative;
  --hero-shrink: 0;
  --hero-scaled: 1;
  padding: calc(10px - (8px * var(--hero-shrink))) 12px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--hero-bg) 85%, transparent);
  box-shadow: var(--shadow);
  animation: float-in 600ms ease-out;
  backdrop-filter: blur(8px);
  transition: padding 220ms ease, transform 220ms ease;
}

.hero-fixed {
  position: sticky;
  top: 12px;
  z-index: 30;
  backdrop-filter: blur(8px);
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-compact {
  min-height: var(--tabs-height);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  transform: translateY(-1px);
}

.hero-compact .brand h1 {
  font-size: 20px;
}

.hero-compact .status {
  display: inline-flex;
}

.hero-compact .hero-top {
  gap: 10px;
  width: 100%;
  align-items: center;
}

.hero-compact .hero-actions {
  gap: 8px;
  transform: none;
}

.hero-compact .lang-switch {
  padding: 4px 6px;
}

.hero-compact .lang-select {
  padding: 4px 8px;
  min-width: 52px;
  font-size: 12px;
}

.hero-compact .logout-btn,
.hero-compact .theme-toggle {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.hero-compact .theme-toggle {
  width: 40px;
}
.logo {
  transition: transform 220ms ease, opacity 220ms ease;
  transform-origin: left center;
  opacity: 1;
}

.hero-compact .logo {
  display: block;
  height: 22px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-actions .ghost,
.hero-actions .theme-toggle,
.hero-actions .logout-btn,
.hero-actions .notif-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  aspect-ratio: 1 / 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  flex: 0 0 32px !important;
  position: relative;
}

.hero-actions .notif-btn {
  display: flex;
  overflow: visible;
  flex: 0 0 32px;
}

.hero-actions .notif-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.hero-actions .notif-btn > * {
  max-width: 100%;
  max-height: 100%;
}

.notif-btn.has-new::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ff6b5a;
  box-shadow: 0 0 0 2px rgba(15, 18, 20, 0.9);
}

.notif-wrap {
  position: relative;
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.auth-open .notif-wrap,
body.auth-open .logout-btn {
  display: none !important;
}

.theme-toggle,
.logout-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 14px;
  border-radius: 10px;
}

.notif-panel {
  position: absolute;
  right: 0 !important;
  left: auto !important;
  top: calc(100% + 10px);
  width: 280px;
  max-width: 90vw;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 18, 18, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  z-index: 1000;
  display: grid;
  gap: 10px;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.notif-mark-read {
  font-size: 12px;
  width: 26px;
  height: 26px;
  padding: 0 !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.notif-mark-read:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.16);
}


.notif-panel[hidden] {
  display: none !important;
}

.notif-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.notif-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.notif-item {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--text);
  display: grid;
  gap: 4px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}

.notif-item.unread {
  background: rgba(255, 210, 96, 0.15);
  border-color: rgba(255, 210, 96, 0.35);
  color: #fff8e6;
}

.notif-item:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 185, 66, 0.5);
}
.notif-time {
  color: var(--muted);
  font-size: 11px;
}

.notif-empty {
  color: var(--muted);
  font-size: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.logo {
  width: 140px;
  height: 140px;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
}

.lang-switch {
  display: inline-flex;
  gap: 7px;
  padding: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-select {
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  padding: 6px 10px;
  min-width: 64px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  appearance: none;
}

.lang-select:focus {
  outline: none;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 7px 7px;
  width: 36px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-btn.active {
  background: rgba(244, 185, 66, 0.18);
  color: var(--accent);
}

.status {
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(244, 185, 66, 0.14);
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  max-width: 100%;
  margin-right: auto;
}

.panel {
  padding: 22px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel-bg) 85%, transparent);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  animation: rise 650ms ease-out;
  backdrop-filter: blur(6px);
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.tabs[hidden] {
  display: none !important;
}

.tabs-fixed {
  position: sticky;
  top: calc(12px + var(--hero-height) + var(--fixed-gap));
  z-index: 25;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  margin-left: auto;
  margin-right: auto;
}

.tab {
  border: 1px solid var(--tab-border);
  background: color-mix(in srgb, var(--tab-bg) 70%, transparent);
  color: var(--text);
  width: 170px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform 140ms ease, box-shadow 140ms ease;
  transform-origin: center;
}

.tab:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  outline: 1px solid rgba(255, 255, 255, 0.18);
  outline-offset: 2px;
}

.tab.active {
  background: linear-gradient(120deg, var(--accent), #ffdd8a);
  color: #1b1b1b;
  border-color: transparent;
}


.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.actions {
  display: flex;
  gap: 10px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input, select, textarea {
  font-family: "Space Grotesk", system-ui, sans-serif;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: color-mix(in srgb, var(--panel-2) 75%, transparent);
  color: var(--text);
  outline: none;
  transition: border 120ms ease, transform 120ms ease;
  backdrop-filter: blur(4px);
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(61, 214, 198, 0.65);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
}

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

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.primary {
  background: linear-gradient(120deg, var(--accent), #ffdd8a);
  border: none;
  color: #1b1b1b;
  font-weight: 700;
  width: 170px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.primary:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 12px 24px rgba(244, 185, 66, 0.28);
  outline: 1px solid rgba(255, 255, 255, 0.2);
  outline-offset: 2px;
}

.ghost {
  border: 1px solid var(--ghost-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  width: 170px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform 140ms ease, box-shadow 140ms ease;
  transform-origin: center;
}

.ghost.notif-btn {
  width: 32px;
  height: 32px;
  font-size: 14px;
  padding: 0;
}

.ghost:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
  outline: 1px solid rgba(255, 255, 255, 0.24);
  outline-offset: 2px;
}

.ghost.danger,
.primary.danger {
  background: linear-gradient(135deg, rgba(255, 107, 95, 0.95), rgba(214, 52, 52, 0.8));
  border: 1px solid rgba(255, 107, 95, 0.75);
  color: #fff6f5;
  box-shadow: 0 14px 28px rgba(214, 52, 52, 0.25);
}

.ghost.danger:hover,
.primary.danger:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 18px 36px rgba(214, 52, 52, 0.35);
  outline: 1px solid rgba(255, 107, 95, 0.45);
}

.logout-btn {
  width: 170px;
  height: 40px;
}

.theme-toggle {
  width: 48px;
  height: 40px;
  font-size: 18px;
  padding: 0;
  transition: transform 140ms ease, box-shadow 140ms ease;
  transform-origin: center;
}

.theme-toggle:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  outline: 1px solid rgba(255, 255, 255, 0.2);
  outline-offset: 2px;
}
.theme-toggle.light {
  background: rgba(255, 255, 255, 0.12);
}


















.stock-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: flex-end;
}

.stock-search {
  display: grid;
  gap: 6px;
  min-width: 200px;
  flex: 1 1 220px;
  margin-left: auto;
}

.stock-search input {
  width: 100%;
}

.cart-btn {
  background: linear-gradient(120deg, #4ee1a2, #c6f6d5);
  color: #0e1f17;
  border: none;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(78, 225, 162, 0.25);
}

.cart-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(78, 225, 162, 0.35);
}

.pricing-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.pricing-current {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 16px;
  backdrop-filter: blur(4px);
}

.limit-alert {
  margin: 8px 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(244, 185, 66, 0.35);
  background: rgba(244, 185, 66, 0.14);
  color: #f4b942;
  font-size: 13px;
}

.limit-alert.danger {
  border-color: rgba(244, 111, 93, 0.5);
  background: rgba(244, 111, 93, 0.16);
  color: #f46f5d;
}

.plan-change-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(78, 225, 162, 0.3);
  background: rgba(78, 225, 162, 0.08);
  margin-bottom: 16px;
}

.plan-change-card .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.plan-change-card .value {
  font-weight: 600;
  margin-top: 4px;
}

.plan-change-card .note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.plan-change-card.pending {
  border-color: rgba(244, 185, 66, 0.45);
  background: rgba(244, 185, 66, 0.12);
}

.plan-change-card.pending .value {
  color: #f4b942;
}

.plan-change-modal-card {
  width: min(560px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.plan-change-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 16, 16, 0.55);
}

.plan-change-modal-card .modal-body {
  overflow: auto;
  padding-right: 6px;
  min-height: 0;
}

.plan-change-agreement {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
  font-size: 10px;
  color: var(--text);
  max-height: none;
  overflow: visible;
  line-height: 1.6;
  white-space: normal;
}

.plan-change-agreement .agreement-heading {
  font-weight: 600;
  color: #f4d181;
  margin-top: 6px;
}

.plan-change-agreement .agreement-line {
  color: rgba(255, 255, 255, 0.88);
}

.plan-change-agreement .agreement-gap {
  height: 8px;
}

.plan-change-agreement .agreement-sheet {
  background: rgba(12, 16, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  font-size: 10px;
  line-height: 1.5;
}

.plan-change-agreement .agreement-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(244, 209, 129, 0.7);
  margin-bottom: 12px;
}

.plan-change-agreement .agreement-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8e4a8;
  margin: 0;
}

.plan-change-agreement .agreement-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: rgba(244, 209, 129, 0.9);
  margin: 4px 0 0 0;
}

.plan-change-agreement .agreement-meta {
  min-width: 180px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
}

.plan-change-agreement .agreement-meta-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.plan-change-agreement .agreement-label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  white-space: nowrap;
}

.plan-change-agreement .agreement-value {
  font-weight: 600;
  color: #fff;
}

.plan-change-agreement .agreement-section-title {
  font-size: 11px;
  font-weight: 800;
  margin: 12px 0 6px 0;
  color: #f8e4a8;
}

.plan-change-agreement .agreement-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 10px;
}

.plan-change-agreement .agreement-card-header {
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  font-weight: 700;
}

.plan-change-agreement .agreement-card-body {
  padding: 10px;
}

.plan-change-agreement .agreement-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10px;
}

.plan-change-agreement .agreement-table th,
.plan-change-agreement .agreement-table td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px;
  vertical-align: top;
  word-break: break-word;
}

.plan-change-agreement .agreement-table th {
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
}

.plan-change-agreement .agreement-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid rgba(244, 209, 129, 0.8);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 209, 129, 0.9);
  font-weight: 600;
}

.plan-change-agreement .agreement-sign {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.plan-change-agreement .agreement-sign-box {
  flex: 1 1 200px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px;
}

.plan-change-agreement .agreement-sign-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.plan-change-agreement .agreement-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

.plan-change-otp {
  display: flex;
  gap: 10px;
  align-items: center;
}

.plan-change-otp input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 10px 12px;
}

.plan-change-otp .ghost {
  white-space: nowrap;
  width: auto;
  min-width: 122px;
  min-height: 42px;
  padding: 0 12px;
  font-size: 12px;
  flex: 0 0 auto;
}


.plan-card {
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(170deg, rgba(16, 24, 24, 0.82), rgba(10, 16, 16, 0.82));
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  perspective: 1200px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.plan-card.featured {
  border-color: rgba(244, 185, 66, 0.55);
  box-shadow: 0 22px 48px rgba(244, 185, 66, 0.2);
}

.plan-card:hover {
  transform: translateY(-3px);
  border-color: rgba(244, 185, 66, 0.6);
}

.plan-inner {
  position: relative;
  width: 100%;
  min-height: 320px;
  transform-style: preserve-3d;
  transition: transform 260ms ease;
}

.plan-card.flipped .plan-inner {
  transform: rotateY(180deg);
}

.plan-front,
.plan-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: grid;
  gap: 10px;
  box-sizing: border-box;
}

.plan-back {
  transform: rotateY(180deg);
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, rgba(20, 30, 30, 0.92), rgba(12, 18, 18, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  grid-template-rows: auto 1fr auto;
}

.plan-back-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.plan-back-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.plan-back-grid > div {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 6px;
}

.plan-back-grid .label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-back-grid .value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.plan-back-hint {
  margin-top: 0;
  font-size: 12px;
  color: var(--muted);
}



.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-header-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.plan-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.plan-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.plan-list li::before {
  content: "• ";
  color: var(--accent);
  font-weight: 700;
}

.plan-upgrade-btn {
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(244, 185, 66, 0.35);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
  cursor: pointer;
}

.plan-upgrade-btn:hover {
  border-color: rgba(244, 185, 66, 0.7);
  background: rgba(244, 185, 66, 0.14);
}

.plan-upgrade-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.plan-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #0f1d1d;
  font-weight: 700;
}

.plan-badge.start { background: #4ee1a2; }
.plan-badge.micro { background: #3dd6d0; }
.plan-badge.standard { background: #6fb9ff; }
.plan-badge.standard-plus { background: #c29bff; }
.plan-badge.business { background: #f4b942; }
.plan-badge.enterprise { background: #ff8a8a; }
.plan-badge.unlimited { background: #f0c4ff; }

.plan-badge.starter { background: #4ee1a2; }
.plan-badge.pro { background: #c29bff; }

.metric-card.plan-card[data-plan="start"],
.metric-card.plan-card[data-plan="starter"] {
  background: linear-gradient(140deg, rgba(78, 225, 162, 0.16), rgba(78, 225, 162, 0.04));
  border-color: rgba(78, 225, 162, 0.35);
}

.metric-card.plan-card[data-plan="micro"] {
  background: linear-gradient(140deg, rgba(61, 214, 208, 0.16), rgba(61, 214, 208, 0.04));
  border-color: rgba(61, 214, 208, 0.35);
}

.metric-card.plan-card[data-plan="standard"] {
  background: linear-gradient(140deg, rgba(111, 185, 255, 0.16), rgba(111, 185, 255, 0.04));
  border-color: rgba(111, 185, 255, 0.35);
}

.metric-card.plan-card[data-plan="standard-plus"],
.metric-card.plan-card[data-plan="pro"] {
  background: linear-gradient(140deg, rgba(194, 155, 255, 0.16), rgba(194, 155, 255, 0.04));
  border-color: rgba(194, 155, 255, 0.35);
}

.metric-card.plan-card[data-plan="business"] {
  background: linear-gradient(140deg, rgba(244, 185, 66, 0.16), rgba(244, 185, 66, 0.04));
  border-color: rgba(244, 185, 66, 0.35);
}

.metric-card.plan-card[data-plan="enterprise"] {
  background: linear-gradient(140deg, rgba(255, 138, 138, 0.16), rgba(255, 138, 138, 0.04));
  border-color: rgba(255, 138, 138, 0.35);
}

.metric-card.plan-card[data-plan="unlimited"] {
  background: linear-gradient(140deg, rgba(240, 196, 255, 0.16), rgba(240, 196, 255, 0.04));
  border-color: rgba(240, 196, 255, 0.35);
}

.plan-current-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.plan-card.active {
  border-color: rgba(78, 225, 162, 0.6);
  box-shadow: 0 20px 40px rgba(78, 225, 162, 0.2);
}


.pricing-oneoff {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 12px;
}

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

.oneoff-item {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: blur(4px);
}

.oneoff-price {
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}




.pill {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.response {
  margin-top: 24px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 10, 10, 0.55);
}

.placeholder {
  color: var(--muted);
  margin: 0;
}

.settings-hidden-form {
  display: contents;
}

.settings-matrix {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto auto auto auto;
  align-items: stretch;
  position: relative;
}

.settings-col-bg {
  grid-row: 1 / 6;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  z-index: 0;
}

.settings-col-bg.col-1 { grid-column: 1; }
.settings-col-bg.col-2 { grid-column: 2; }
.settings-col-bg.col-3 { grid-column: 3; }

.settings-cell {
  padding: 12px 16px;
  display: grid;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.settings-head {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.settings-cell .note {
  margin-top: 0;
}

.settings-cell.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.settings-empty {
  min-height: 0;
}

.settings-accountant-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}

.settings-status-card {
  margin-bottom: 22px;
}

.settings-accountant-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.settings-accountant-list {
  display: grid;
  gap: 8px;
}

.settings-accountant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.settings-accountant-item .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-accountant-item .value {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}

.settings-accountant-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}



.accountant-modal-card {
  width: min(520px, 92vw);
}

.accountant-form {
  display: grid;
  gap: 12px;
}

.lead-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lead-form label {
  display: grid;
  gap: 8px;
}

.lead-form label.full {
  grid-column: 1 / -1;
}

.lead-form .stock-form-actions {
  grid-column: 1 / -1;
}


.col-1 { grid-column: 1; }
.col-2 { grid-column: 2; }
.col-3 { grid-column: 3; }
.row-1 { grid-row: 1; }
.row-2 { grid-row: 2; }
.row-3 { grid-row: 3; }
.row-4 { grid-row: 4; }
.row-5 { grid-row: 5; }

.login-form {
  display: grid;
  gap: 16px;
  max-width: 420px;
}

.login-form[hidden] {
  display: none !important;
}

.login-form label {
  margin: 0;
}

.login-links {
  margin-top: 4px;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: transform 140ms ease, color 140ms ease;
  transform-origin: center;
}

.link-btn:hover {
  transform: translateY(-1px) scale(1.03);
  color: #ffdd8a;
  text-decoration: underline;
}

.note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.settings-divider {
  margin: 18px 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.cert-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}


.file-input {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-input input[type="file"] {
  display: none;
}

.file-btn {
  width: 170px;
  height: 40px;
}

.file-name {
  color: var(--muted);
  font-size: 12px;
}
#history-panel {
  --history-max-width: 980px;
}

.history-shell {
  width: min(var(--history-max-width), 100%);
  margin-left: auto;
  margin-right: auto;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-live {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(61, 214, 198, 0.45);
  background: rgba(32, 86, 80, 0.16);
  color: #c9fff1;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(6px);
  animation: rise 220ms ease;
}

.history-filters {
  margin-bottom: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1.1fr 1.4fr 1fr;
  align-items: end;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 18, 24, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: calc(12px + var(--hero-height) + var(--fixed-gap) + var(--tabs-height) + var(--fixed-gap));
  z-index: 6;
}

.history-field {
  min-width: 0;
}

.history-live,
.history-loading {
}

.history-filters label {
  min-width: 0;
}

.history-filters select,
.history-filters input[type="date"],
.history-filters input[type="number"],
.history-filters input[type="text"] {
  width: 100%;
}

.history-filters select {
  min-width: 220px;
}

.history-filters input[type="date"],
.history-filters input[type="number"],
.history-filters input[type="text"] {
  min-width: 150px;
}

.history-actions-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.history-actions-group {
  display: contents;
}

.history-filters .history-actions-row .action-btn {
  width: auto;
  min-width: 110px;
}


.history-filters input[type="date"] {
  color-scheme: dark;
  padding-right: 44px;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 50% 50%, rgba(78, 225, 162, 0.8) 0 2px, transparent 3px);
  background-repeat: no-repeat;
  background-size: 100% 100%, 10px 10px;
  background-position: left top, right 18px center;
}

.history-filters input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.85;
  filter: invert(0.9) hue-rotate(180deg);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
}

.history-filters input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background: rgba(255, 255, 255, 0.14);
}

.history-range {
  position: relative;
}

.range-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.range-input input {
  width: 100%;
}

.range-clear {
  height: 40px;
  padding: 0 14px;
  font-size: 12px;
}

.range-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 12;
  padding: 12px;
  border-radius: 14px;
  background: rgba(12, 18, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.range-title {
  font-weight: 600;
  text-transform: capitalize;
}

.range-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.range-weekdays span {
  text-align: center;
}

.range-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.range-day {
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  height: 32px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.range-day:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
}

.range-day.is-outside {
  opacity: 0.35;
}

.range-day.is-range {
  background: rgba(78, 225, 162, 0.18);
  border-color: rgba(78, 225, 162, 0.45);
}

.range-day.is-start,
.range-day.is-end {
  background: linear-gradient(135deg, rgba(78, 225, 162, 0.9), rgba(111, 185, 255, 0.9));
  color: #0b0f14;
  border-color: transparent;
}

.history-filters .action-btn {
  height: 40px;
  align-self: end;
  width: 100%;
}

.history-filters input[type="number"]::-webkit-outer-spin-button,
.history-filters input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.history-filters input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.history-loading {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.history-sentinel {
  height: 1px;
}

.reports-filters {
  margin-bottom: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(4px);
}

.reports-filters label {
  min-width: 0;
}

.reports-filters select,
.reports-filters input[type="date"] {
  width: 100%;
}

.reports-filters .action-btn {
  height: 40px;
  width: 100%;
  align-self: end;
}

.reports-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 16px;
}

.metric-split {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-split .split-divider {
  color: var(--muted);
}

.reports-section {
  margin-bottom: 18px;
}

.section-title {
  margin-bottom: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.reports-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.report-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.report-card.warn {
  border-color: rgba(244, 111, 93, 0.5);
  background: rgba(244, 111, 93, 0.12);
}

.report-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.report-value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.report-line {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.report-line strong {
  color: var(--text);
  font-weight: 600;
}

.report-table-wrap {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  overflow: auto;
}

.report-table-head,
.report-row {
  display: grid;
  grid-template-columns: 140px 120px 120px 120px 120px;
  gap: 12px;
  padding: 12px 14px;
  align-items: center;
  font-size: 13px;
}

.report-table-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.report-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.report-row.empty {
  text-align: center;
  color: var(--muted);
}

.report-table-head--details,
.report-row--details {
  grid-template-columns: 160px 160px 140px 110px 90px 90px 110px 90px 90px 90px 80px;
}

.report-receipt .muted {
  font-size: 12px;
  color: var(--muted);
}

.reports-empty {
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.reports-loading {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.status-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.status-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 10px;
}

.status-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.status-pill {
  align-self: start;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.status-pill.ok {
  border-color: rgba(61, 214, 198, 0.5);
  background: rgba(61, 214, 198, 0.16);
  color: #c9fff1;
}

.status-pill.issue {
  border-color: rgba(244, 111, 93, 0.5);
  background: rgba(244, 111, 93, 0.16);
  color: #f46f5d;
}

.status-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.history-item {
  display: grid;
  grid-template-columns: 120px minmax(140px, 1fr) minmax(140px, 1fr) minmax(90px, 130px) minmax(140px, 200px) minmax(140px, 180px);
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(61, 214, 198, 0.16);
  background: linear-gradient(135deg, rgba(22, 44, 42, 0.92), rgba(16, 26, 26, 0.92));
  font-size: 13px;
  color: var(--muted);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  backdrop-filter: blur(4px);
  box-sizing: border-box;
  width: 100%;
}

.history-item + .history-item {
  margin-top: 10px;
}

.history-item:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(244, 185, 66, 0.55);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
}

.history-item.is-highlight {
  border-color: rgba(244, 185, 66, 0.9);
  box-shadow: 0 18px 36px rgba(244, 185, 66, 0.2);
}



.history-actions {
  display: grid;
  gap: 8px;
  width: 100%;
}

.action-btn {
  width: 100%;
  height: 32px;
  padding: 0;
  font-size: 12px;
}

.stock-add-cart.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-support-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-support-bar .ghost {
  min-height: 40px;
}

.settings-support-history {
  margin-top: 8px;
  display: grid;
  gap: 10px;
}

.support-history-list {
  display: grid;
  gap: 12px;
}

.support-history-item {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 24, 26, 0.4);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.support-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.support-details-btn {
  min-width: 90px;
}

.support-history-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.support-history-head .pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(244, 185, 66, 0.18);
  color: #f6d488;
  font-size: 11px;
  font-weight: 600;
}

.support-history-head .status {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--muted);
}

.support-history-head .status.ok {
  background: rgba(61, 214, 198, 0.16);
  color: #b9fff5;
}

.support-history-head .status.warn {
  background: rgba(244, 185, 66, 0.18);
  color: #f6d488;
}

.support-history-head .date {
  font-size: 12px;
  color: var(--muted);
}

.support-message {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.support-accordion {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
  display: grid;
  gap: 8px;
}

.support-history-item.open {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(17, 24, 26, 0.55);
}

.support-receipt {
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.support-answer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
  display: grid;
  gap: 4px;
}

.support-answer .value {
  color: var(--text);
  font-size: 13px;
}

.settings-matrix .file-input {
  flex-wrap: wrap;
}

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

.modal[hidden] {
  display: none !important;
}

.modal-card {
  width: min(680px, 92vw);
  background: linear-gradient(160deg, rgba(17, 28, 28, 0.86), rgba(10, 18, 18, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.support-modal-card {
  padding: 20px 22px;
}

.confirm-modal-card {
  max-width: 520px;
}

.confirm-message {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.lead-modal-card {
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}

.lead-modal-card .modal-body {
  overflow: auto;
}

.modal-card-wide {
  width: min(1100px, 96vw);
  height: min(90vh, 1000px);
  display: flex;
  flex-direction: column;
}

.scanner-modal-card {
  width: min(720px, 96vw);
}

.scanner-modal-body {
  display: grid;
  gap: 16px;
}

.scanner-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
}

.scanner-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-status {
  font-size: 14px;
  color: var(--muted);
}

.scanner-status[data-kind="error"] {
  color: #ff8c8c;
}

.scanner-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.scanner-actions .is-active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(78, 225, 162, 0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-body {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.upgrade-modal-card {
  width: min(520px, 92vw);
}

.upgrade-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 16, 16, 0.55);
}

.upgrade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.upgrade-row .label {
  color: var(--muted);
}

.upgrade-row .value {
  font-weight: 600;
  color: var(--text);
}

.upgrade-row.accent .value {
  color: var(--accent);
}

.upgrade-row.muted .value {
  color: var(--muted);
}

.upgrade-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text);
}

.upgrade-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.upgrade-mode {
  display: grid;
  gap: 8px;
}

.upgrade-mode .label {
  font-size: 12px;
  color: var(--muted);
}

.upgrade-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 16, 16, 0.55);
}

.upgrade-mode-option {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.upgrade-mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upgrade-mode-option span {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s ease;
}

.upgrade-mode-option input:checked + span {
  color: #0f1413;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(78, 225, 162, 0.4);
}

.upgrade-mode-option input:disabled + span {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.upgrade-error {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(244, 111, 93, 0.4);
  background: rgba(244, 111, 93, 0.16);
  color: #f46f5d;
  font-size: 12px;
}

.custom-plan-modal-card {
  width: min(520px, 92vw);
}

.custom-plan-mode {
  display: grid;
  gap: 8px;
}

.custom-plan-options {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 16, 16, 0.55);
}

.custom-plan-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.custom-plan-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-plan-option span {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s ease;
}

.custom-plan-option input:checked + span {
  color: #0f1413;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(78, 225, 162, 0.4);
}

.custom-plan-field {
  display: grid;
  gap: 6px;
}

.custom-plan-field input {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 16, 16, 0.45);
  color: var(--text);
}

.custom-plan-error {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(244, 111, 93, 0.4);
  background: rgba(244, 111, 93, 0.16);
  color: #f46f5d;
  font-size: 12px;
}

.support-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.support-form label {
  display: grid;
  gap: 8px;
}

.support-form label span {
  font-size: 12px;
  letter-spacing: 0.2px;
  color: var(--muted);
}

.support-form label.full,
.support-form .settings-actions.full {
  grid-column: 1 / -1;
}

.support-form textarea,
.support-form input,
.support-form select {
  width: 100%;
  border-radius: 12px;
  background: rgba(9, 16, 16, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.support-form textarea {
  min-height: 120px;
  resize: vertical;
}

.support-form textarea:focus,
.support-form input:focus,
.support-form select:focus {
  outline: none;
  border-color: rgba(244, 185, 66, 0.45);
  box-shadow: 0 0 0 2px rgba(244, 185, 66, 0.18);
}

.support-form .settings-actions {
  justify-content: flex-end;
  margin-top: 2px;
}


.modal-card-wide .modal-body {
  flex: 1;
  min-height: 0;
}

.reports-modal-body {
  overflow: auto;
}

.docs-modal-body {
  overflow: auto;
  padding: 18px 20px 24px;
}

.docs-modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.docs-download-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.docs-download-btn {
  width: auto;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 10px;
}

.docs-download-btn[disabled] {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.docs-download-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  box-sizing: border-box;
  flex-shrink: 0;
  display: inline-block;
  line-height: 0;
  opacity: 0;
  transition: opacity 160ms ease;
  transform-origin: center;
  animation: docs-spin 0.9s linear infinite;
}

.docs-download-spinner.is-visible {
  opacity: 1;
}

.docs-modal-actions .modal-close {
  width: 36px;
  height: 34px;
  padding: 0;
}

.docs-content {
  margin: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.docs-content h1,
.docs-content h2,
.docs-content h3,
.docs-content h4 {
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--text);
}

.docs-content h1 {
  font-size: 22px;
}

.docs-content h2 {
  font-size: 18px;
}

.docs-content h3 {
  font-size: 16px;
}

.docs-content p {
  margin: 0 0 12px;
  color: var(--text);
}

.docs-content a {
  color: var(--accent);
  text-decoration: none;
}

.docs-content a:hover {
  text-decoration: underline;
}

.docs-content ul,
.docs-content ol {
  margin: 0 0 12px 18px;
  padding: 0;
}

.docs-content li {
  margin: 0 0 6px;
}

.docs-content code {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 6px;
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
}

.docs-content pre {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  white-space: pre;
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.docs-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 13px;
}

.docs-content th,
.docs-content td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.docs-content th {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.docs-pdf-export {
  position: fixed;
  left: 120vw;
  top: 0;
  width: 880px;
  max-width: 880px;
  padding: 24px;
  background: #ffffff;
  color: #1e252c;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  --text: #1e252c;
  --text-muted: #5f6a74;
  --panel-border: rgba(0, 0, 0, 0.12);
  --accent: #d39a19;
}

.docs-pdf-export .docs-content {
  font-size: 13px;
  line-height: 1.55;
}

.docs-pdf-export .docs-content table {
  border-collapse: collapse;
  width: 100%;
}

.docs-pdf-export .docs-content th,
.docs-pdf-export .docs-content td {
  border: 1px solid rgba(0, 0, 0, 0.24);
}

.docs-pdf-export .docs-content th {
  background: rgba(0, 0, 0, 0.06);
  color: #1e252c;
}

.docs-pdf-export .docs-content pre {
  background: #0f1419;
  color: #e6edf3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: hidden;
}

.docs-pdf-export .docs-content code {
  white-space: pre-wrap;
}

@keyframes docs-spin {
  to {
    transform: rotate(360deg);
  }
}

#pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
  background: #0b0f0f;
}

.pdf-header {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pdf-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdf-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdf-open {
  text-decoration: none;
}

.pdf-body {
  background: linear-gradient(180deg, rgba(6, 10, 10, 0.4), rgba(6, 10, 10, 0.1));
  border-radius: 14px;
  padding: 10px;
}

.pdf-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 12px;
  height: 100%;
  min-height: 60vh;
}

.pdf-side {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(11, 15, 15, 0.55);
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.pdf-send-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
}

/* Ensure the input isn't visually hidden behind the Send button on small widths */
#pdf-email {
  min-width: 0;
  width: 100%;
}

#pdf-send {
  width: 100%;
  white-space: nowrap;
}

.pdf-send-status {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  overflow-wrap: anywhere;
}

.pdf-send-status.is-ok {
  border-color: rgba(70, 210, 120, 0.25);
  background: rgba(70, 210, 120, 0.08);
}

.pdf-send-status.is-err {
  border-color: rgba(255, 80, 80, 0.25);
  background: rgba(255, 80, 80, 0.08);
}

.pdf-view {
  height: 100%;
  min-height: 60vh;
}

@media (max-width: 900px) {
  .pdf-layout {
    grid-template-columns: 1fr;
  }
  .pdf-view {
    min-height: 65vh;
  }
}

/* Keep send controls stacked even on wide screens so the email is always fully visible. */



.return-type {
  display: flex;
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.forgot-actions {
  display: flex;
  justify-content: flex-start;
}

.forgot-reset {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.register-verify {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.agreement-consent {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.agreement-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.agreement-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.agreement-link {
  font-size: 12px;
}

.agreement-modal-card {
  width: min(900px, 92vw);
}

.agreement-body {
  max-height: min(70vh, 560px);
  overflow: auto;
  padding-right: 6px;
}

.agreement-text {
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.55;
}

.agreement-body,
.cart-list,
.notif-list,
.report-table-wrap,
.lead-modal-card .modal-body,
.reports-modal-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 186, 94, 0.75) rgba(255, 255, 255, 0.08);
}

.agreement-body::-webkit-scrollbar,
.cart-list::-webkit-scrollbar,
.notif-list::-webkit-scrollbar,
.report-table-wrap::-webkit-scrollbar,
.lead-modal-card .modal-body::-webkit-scrollbar,
.reports-modal-body::-webkit-scrollbar {
  width: 10px;
}

.agreement-body::-webkit-scrollbar-track,
.cart-list::-webkit-scrollbar-track,
.notif-list::-webkit-scrollbar-track,
.report-table-wrap::-webkit-scrollbar-track,
.lead-modal-card .modal-body::-webkit-scrollbar-track,
.reports-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.agreement-body::-webkit-scrollbar-thumb,
.cart-list::-webkit-scrollbar-thumb,
.notif-list::-webkit-scrollbar-thumb,
.report-table-wrap::-webkit-scrollbar-thumb,
.lead-modal-card .modal-body::-webkit-scrollbar-thumb,
.reports-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 188, 92, 0.95), rgba(244, 111, 93, 0.85));
  border-radius: 999px;
  border: 2px solid rgba(12, 18, 18, 0.85);
}

.agreement-body::-webkit-scrollbar-thumb:hover,
.cart-list::-webkit-scrollbar-thumb:hover,
.notif-list::-webkit-scrollbar-thumb:hover,
.report-table-wrap::-webkit-scrollbar-thumb:hover,
.lead-modal-card .modal-body::-webkit-scrollbar-thumb:hover,
.reports-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 205, 120, 1), rgba(255, 136, 118, 0.9));
}




.payment-type {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.payment-total {
  font-size: 14px;
  color: var(--muted);
}

.payment-total strong {
  color: var(--text);
  margin-left: 8px;
}

.items-list {
  display: grid;
  gap: 8px;
}

.item-row {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.item-row input {
  width: 100%;
}

.history-item .value {
  color: var(--text);
  font-weight: 600;
}

.history-item .chip {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(244, 185, 66, 0.14);
  color: var(--accent);
  font-size: 11px;
}

.stock-list {
  margin-top: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  transition: opacity 140ms ease;
}

.stock-list.is-loading {
  opacity: 0.6;
}

.stock-card {
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: color-mix(in srgb, var(--panel-2) 85%, transparent);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  backdrop-filter: blur(4px);
}

.stock-image {
  height: 140px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}



.stock-card:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(244, 185, 66, 0.6);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.stock-card.out {
  border-color: rgba(235, 84, 84, 0.85);
  box-shadow: 0 0 0 1px rgba(235, 84, 84, 0.18);
}

.stock-card.out:hover {
  border-color: rgba(235, 84, 84, 0.95);
  box-shadow: 0 16px 28px rgba(235, 84, 84, 0.22);
}




.stock-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stock-body {
  padding: 12px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.stock-title {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}

.stock-meta {
  display: grid;
  gap: 4px;
}

.stock-meta .value {
  color: var(--text);
  font-weight: 600;
}

.stock-footer {
  margin-top: auto;
  padding: 10px 12px 12px;
}

.cart-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 12px;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
  align-items: start;
  height: 100%;
  min-height: 0;
}

.cart-panel {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--panel) 75%, transparent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 12px;
  min-height: 0;
}

.cart-items {
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}

.cart-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  min-height: 0;
  --cart-row-height: 72px;
  max-height: calc((var(--cart-row-height) * 7) + (10px * 6));
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(155deg, rgba(14, 22, 22, 0.95), rgba(10, 16, 16, 0.85));
  min-height: var(--cart-row-height);
}

.cart-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cart-item > div > div:first-child,
.cart-item-head {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cart-item-head {
  display: block;
  min-width: 0;
}

.cart-item-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.cart-item-title .value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-price {
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.cart-item > div:last-child {
  justify-items: end;
}

.cart-item .value {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item input {
  width: 100%;
  padding: 8px 10px;
  max-width: 100%;
}

.cart-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  width: 28px;
  padding: 0;
  min-width: 28px;
  max-width: 28px;
  font-size: 12px;
  border-radius: 8px;
}

.cart-remove-text {
  display: none;
}

.cart-remove-icon {
  display: inline-block;
}

.cart-qty-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-right: 2px;
}

.cart-qty-row input {
  width: 100%;
  min-width: 0;
}

.cart-qty-row .cart-remove {
  width: 28px;
  height: 28px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.cart-total strong {
  color: var(--text);
  font-size: 16px;
}

.cart-checkout {
  display: grid;
  gap: 12px;
}

.cart-payments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cart-payment-field {
  display: grid;
  gap: 6px;
}

.cart-payment-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cart-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.cart-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(244, 111, 93, 0.15);
  color: var(--danger);
  font-size: 13px;
}

.cart-list .placeholder {
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}





.stock-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ADG autocomplete dropdown (custom, because <datalist> placement is inconsistent across browsers) */
.adg-dropdown {
  position: fixed;
  z-index: 99999;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(8, 12, 14, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.adg-dropdown[hidden] {
  display: none !important;
}

.adg-dropdown::-webkit-scrollbar {
  width: 10px;
}

.adg-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.adg-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.adg-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
  border: 3px solid transparent;
  background-clip: padding-box;
}

.adg-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.adg-option:hover,
.adg-option.is-active {
  background: rgba(255, 255, 255, 0.08);
}

.adg-option-code {
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.95;
  white-space: nowrap;
}

.adg-option-name {
  opacity: 0.9;
  line-height: 1.25;
  word-break: break-word;
}





.profile-card.alt {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(16, 26, 26, 0.62), rgba(10, 18, 18, 0.62));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.profile-left {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
}

.profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.profile-logo-text {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0f1d1d;
  background: linear-gradient(120deg, var(--accent), #ffdd8a);
}

.profile-badge.has-logo .profile-logo-text {
  display: none;
}

.profile-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.profile-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.profile-subvalue {
  margin-top: 4px;
  font-size: 15px;
  color: var(--text);
}

.profile-id-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.profile-id {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.profile-id .label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-id .value {
  margin-top: 4px;
  font-size: 15px;
  color: var(--text);
}

.profile-right {
  display: grid;
  gap: 14px;
}

.metric-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(4px);
}

.metric-card.accent {
  background: linear-gradient(140deg, rgba(244, 185, 66, 0.16), rgba(61, 214, 198, 0.12));
  border-color: rgba(244, 185, 66, 0.4);
}

.metric-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-big {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}




.profile-upload {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-upload .hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}


.profile-history {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 12px;
}

details.profile-history {
  display: block;
}

details.profile-history > summary {
  list-style: none;
  cursor: pointer;
}

details.profile-history > summary::-webkit-details-marker {
  display: none;
}

details.profile-history > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

details.profile-history > summary::after {
  content: "▾";
  font-size: 16px;
  color: var(--muted);
  transition: transform 160ms ease;
}

details.profile-history[open] > summary::after {
  transform: rotate(180deg);
}

.profile-accountant-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}

.contract-text {
  width: 100%;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 16, 24, 0.55);
}

.profile-accountant-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.profile-history-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.profile-history-head,
.profile-history-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 0.9fr) minmax(120px, 0.7fr);
  gap: 12px;
  align-items: center;
}

.profile-history-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.profile-history-list {
  display: grid;
  gap: 10px;
}

.profile-history-row {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.015);
}

.security-card {
  display: grid;
  gap: 8px;
}

.security-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.security-row .label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.security-row .value {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.profile-history-row .value {
  font-size: 14px;
  color: var(--text);
}

.profile-history-row .muted {
  color: var(--muted);
}

.profile-history-empty {
  font-size: 14px;
  color: var(--muted);
}




.response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c9d6d6;
  font-size: 13px;
}

.bg-orb {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  z-index: -2;
}


.orb-a {
  background: #2fb8a8;
  top: -120px;
  left: -120px;
}

.orb-b {
  background: #f4b942;
  bottom: -160px;
  right: -120px;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  z-index: -1;
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(32, 86, 80, 0.96);
  border: 1px solid rgba(61, 214, 198, 0.45);
  color: #e7fff9;
  box-shadow: var(--shadow);
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, -50%) translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.error {
  background: rgba(122, 24, 24, 0.94);
  border: 1px solid rgba(255, 120, 120, 0.55);
  color: #fff2f2;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

.is-mobile .toast {
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(92vw, 520px);
  z-index: 120;
}

.is-mobile .toast.show {
  transform: translateX(-50%) translateY(0);
}

.mobile-nav {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  height: 64px;
  border-radius: 18px;
  background: rgba(12, 18, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  z-index: 45;
}

.mobile-tab {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  display: grid;
  gap: 4px;
  place-items: center;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.mobile-tab:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
}

.mobile-tab.active {
  background: linear-gradient(120deg, var(--accent), #ffdd8a);
  color: #1b1b1b;
  font-weight: 700;
}

.mobile-icon {
  font-size: 18px;
  line-height: 1;
}

.mobile-label {
  font-size: 9px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 10, 0.72);
  backdrop-filter: blur(10px);
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.mobile-menu-card {
  width: min(520px, 100%);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(20, 28, 28, 0.96), rgba(10, 18, 18, 0.96));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 14px;
  animation: rise 240ms ease-out;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu-title {
  font-family: "DM Serif Display", serif;
  font-size: 20px;
  position: static;
}

.mobile-menu-close {
  order: 2;
}

.mobile-menu-close {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  font-size: 14px;
}

.mobile-menu-body {
  display: grid;
  gap: 12px;
}

.mobile-menu-item {
  border: 1px solid var(--ghost-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  height: 44px;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  justify-content: flex-start;
  text-align: left;
}

.mobile-menu-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex: 0 0 20px;
}

.mobile-menu-text {
  flex: 0 1 auto;
  text-align: left;
}

.mobile-menu-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

body.mobile-menu-open {
  overflow: hidden;
}

@keyframes float-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes rise {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}




.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-plans-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.admin-leads-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-leads-summary-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.admin-leads-summary-item {
  display: grid;
  gap: 4px;
}

.admin-leads-summary-item .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.admin-leads-summary-item .value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.admin-leads-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 14px;
}

.admin-leads-filters {
  display: grid;
  gap: 10px;
}

.admin-leads-search input {
  min-width: 200px;
}

.admin-leads-filter {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.admin-leads-filter select {
  min-width: 180px;
}




.admin-lead {
  position: relative;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(150deg, rgba(16, 23, 25, 0.84), rgba(12, 18, 20, 0.92));
  backdrop-filter: blur(10px);
  padding: 18px;
  display: grid;
  gap: 14px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.admin-lead:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.3);
}

.admin-lead::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(240px 120px at 10% 0%, rgba(61, 214, 198, 0.16), transparent 70%);
  pointer-events: none;
}

.admin-lead-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.admin-lead-head .pill {
  justify-self: end;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(61, 214, 198, 0.16);
  color: #b9fff5;
  font-size: 12px;
  font-weight: 600;
}

.admin-lead-head .status-New {
  background: linear-gradient(135deg, rgba(87, 156, 255, 0.8), rgba(49, 110, 255, 0.3));
  color: #e8f2ff;
  border: 1px solid rgba(87, 156, 255, 0.8);
}

.admin-lead-head .status-Contacted {
  background: linear-gradient(135deg, rgba(61, 214, 198, 0.8), rgba(36, 166, 154, 0.3));
  color: #e4fff7;
  border: 1px solid rgba(61, 214, 198, 0.8);
}

.admin-lead-head .status-Interested {
  background: linear-gradient(135deg, rgba(126, 231, 135, 0.82), rgba(72, 189, 86, 0.32));
  color: #ebffef;
  border: 1px solid rgba(126, 231, 135, 0.85);
}

.admin-lead-head .status-DemoDone {
  background: linear-gradient(135deg, rgba(255, 200, 87, 0.88), rgba(214, 138, 14, 0.35));
  color: #fff6dc;
  border: 1px solid rgba(255, 200, 87, 0.9);
}

.admin-lead-head .status-WaitingDecision {
  background: linear-gradient(135deg, rgba(255, 166, 106, 0.9), rgba(214, 94, 42, 0.4));
  color: #fff0e0;
  border: 1px solid rgba(255, 166, 106, 0.9);
}

.admin-lead-head .status-Rejected {
  background: linear-gradient(135deg, rgba(244, 111, 93, 0.9), rgba(196, 54, 46, 0.4));
  color: #ffe7e3;
  border: 1px solid rgba(244, 111, 93, 0.9);
}

.admin-lead-head .status-Converted {
  background: linear-gradient(135deg, rgba(152, 120, 255, 0.85), rgba(96, 64, 214, 0.35));
  color: #f0e9ff;
  border: 1px solid rgba(152, 120, 255, 0.9);
}

.admin-lead-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-lead-card {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 6px;
}

.admin-lead-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.admin-lead-card .value {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  word-break: break-word;
}

.admin-lead-card {
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.admin-lead-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.admin-lead-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.admin-lead-inline {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.admin-lead-inline textarea {
  min-height: 64px;
}

.admin-lead-inline.grow {
  grid-column: span 2;
}

.admin-lead-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}






.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.system-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.system-meta .value {
  font-size: 13px;
  color: var(--text);
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.system-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(150deg, rgba(18, 28, 30, 0.85), rgba(12, 18, 20, 0.9));
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.system-card .value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.system-card .value.ok {
  color: #9ff3e9;
}

.system-card .value.bad {
  color: #f9b2a8;
}

.system-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(200px 120px at 10% 0%, rgba(61, 214, 198, 0.12), transparent 70%);
  opacity: 0.8;
  pointer-events: none;
}

.system-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0;
}

.system-panel {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(150deg, rgba(18, 28, 30, 0.85), rgba(12, 18, 20, 0.92));
  padding: 16px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.system-counters {
  display: grid;
  gap: 10px;
}

.system-counter-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.system-counter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.system-counter-item strong {
  font-size: 13px;
  color: var(--text);
}

.system-errors {
  display: grid;
  gap: 8px;
}

.system-error {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.system-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 12px;
}

.system-action {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(150deg, rgba(18, 28, 30, 0.85), rgba(12, 18, 20, 0.92));
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.system-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.system-action-row input {
  max-width: 120px;
  flex: 1 1 120px;
}

.system-action-row .ghost {
  flex: 1 1 140px;
  min-width: 140px;
}

.system-action-row .unit {
  font-size: 12px;
  color: var(--muted);
}

.system-chart {
  overflow-x: auto;
  padding-bottom: 6px;
}

.system-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(26px, 1fr);
  gap: 8px;
  align-items: end;
  min-height: 160px;
}

.system-bar {
  display: grid;
  align-items: end;
  gap: 6px;
  justify-items: center;
  color: var(--muted);
  font-size: 10px;
  transition: transform 140ms ease;
}

.system-bar-total {
  width: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(61, 214, 198, 0.9), rgba(61, 214, 198, 0.25));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  position: relative;
}

.system-bar-failed {
  width: 10px;
  border-radius: 999px;
  margin-top: -6px;
  background: linear-gradient(180deg, rgba(244, 111, 93, 0.9), rgba(244, 111, 93, 0.25));
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.18);
}

.system-bar:hover {
  transform: translateY(-4px) scale(1.08);
}

.system-chart-tooltip {
  position: absolute;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 20, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}




.admin-section {
  display: block;
}

.admin-list {
  display: grid;
  gap: 14px;
}

#admin-tickets-list {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 6px;
}

.admin-chat {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 16px;
  min-height: 420px;
  max-height: 70vh;
}

.admin-chat-list {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 70vh;
  max-height: 70vh;
  min-height: 0;
  overflow-y: auto;
}

.admin-chat-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 140ms ease, border-color 140ms ease;
  position: relative;
}

.admin-chat-item.active {
  border-color: rgba(244, 185, 66, 0.6);
  background: rgba(244, 185, 66, 0.12);
}

.admin-chat-item.has-unread::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f46f5d;
  box-shadow: 0 0 0 2px rgba(27, 27, 27, 0.6);
}

.admin-chat-item:hover {
  transform: translateY(-1px);
}

.admin-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.12) 38%, rgba(0, 0, 0, 0.2) 100%),
    linear-gradient(135deg, rgba(255, 206, 100, 0.35), rgba(110, 226, 255, 0.22));
  border: 1px solid rgba(255, 210, 120, 0.25);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #f5f7ff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
}

.admin-chat-item.active .admin-chat-avatar {
  border-color: rgba(255, 210, 96, 0.7);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 210, 96, 0.18);
}

.admin-chat-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-chat-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-chat-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-chat-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #57d48a;
  box-shadow: 0 0 0 2px rgba(18, 24, 24, 0.7);
  flex: 0 0 6px;
}

.admin-chat-status-dot.closed {
  background: #f46f5d;
}

.admin-chat-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-chat-window {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 75%, transparent);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 70vh;
  max-height: 70vh;
}

.admin-chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-chat-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-chat-title {
  font-weight: 700;
  font-size: 14px;
}

.admin-chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.admin-chat-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #57d48a;
  box-shadow: 0 0 0 2px rgba(18, 24, 24, 0.7);
}

.admin-chat-status.closed {
  color: #f5b0a6;
  border-color: rgba(244, 111, 93, 0.4);
  background: rgba(244, 111, 93, 0.12);
}

.admin-chat-status.closed::before {
  background: #f46f5d;
}

.admin-chat-footer.is-closed {
  opacity: 0.6;
  pointer-events: none;
}

.admin-chat-close {
  padding: 6px 10px !important;
  border-radius: 999px !important;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-chat-close:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-chat-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.admin-chat-body.chat-drop-active {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

.admin-chat-body .chat-msg {
  max-width: 85%;
  width: fit-content;
  display: inline-flex;
}

.admin-chat-msg-time {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.7;
}

.admin-chat-msg-status {
  margin-top: 2px;
  font-size: 11px;
  opacity: 0.7;
  text-align: right;
}

.admin-chat-body .chat-msg.me .admin-chat-msg-time {
  text-align: right;
}

.admin-chat-body .chat-msg.them .admin-chat-msg-time {
  text-align: left;
}

.admin-chat-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.chat-reply-bar {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.06);
}

.chat-reply-info {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.chat-reply-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.chat-reply-snippet {
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-reply-close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-reply-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.16);
}

.chat-reply-preview {
  border-left: 2px solid var(--accent);
  border-radius: 10px;
  padding: 4px 8px;
  margin-bottom: 6px;
  background: rgba(0, 0, 0, 0.2);
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
}

.chat-reply-preview .chat-reply-author {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.chat-reply-preview .chat-reply-snippet {
  font-size: 12px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.chat-rating {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  display: grid;
  gap: 8px;
}

.chat-rating-title {
  font-size: 12px;
  color: var(--text);
}

.chat-rating-stars {
  display: flex;
  gap: 6px;
}

.chat-rating-star {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.chat-rating-star.active {
  color: #1b1b1b;
  background: var(--accent);
}

.chat-rating-comment {
  width: 100%;
  min-height: 48px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 12, 14, 0.7);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
}

.chat-rating-actions {
  display: flex;
  justify-content: flex-end;
}

.chat-rating-submit {
  border: none;
  background: var(--accent);
  color: #1b1b1b;
  padding: 6px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.chat-rating-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-rating-thanks {
  font-size: 12px;
  color: var(--text);
}

.chat-system-note {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.admin-chat-footer input,
.admin-chat-footer textarea {
  flex: 1;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 12, 14, 0.7);
  color: var(--text);
  resize: none;
  min-height: 46px;
  max-height: 140px;
  overflow-y: auto;
  line-height: 1.4;
}

.admin-user {
  position: relative;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(150deg, rgba(16, 23, 25, 0.84), rgba(12, 18, 20, 0.92));
  backdrop-filter: blur(10px);
  padding: 18px 18px 16px;
  display: grid;
  gap: 14px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.admin-user-actions {
  display: grid;
  gap: 8px;
}

.admin-user-plan {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-user-plan select {
  min-width: 220px;
}

.admin-user-plan-date {
  color: var(--muted);
  font-size: 12px;
}

.admin-user::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(260px 130px at 10% 0%, rgba(244, 185, 66, 0.14), transparent 70%);
  pointer-events: none;
}

.admin-user:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.3);
}

.admin-user .pill {
  background: rgba(61, 214, 198, 0.16);
  color: #b9fff5;
}



.admin-plan {
  position: relative;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(16, 23, 25, 0.86), rgba(10, 16, 18, 0.92));
  backdrop-filter: blur(10px);
  padding: 18px 18px 16px;
  display: grid;
  gap: 16px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.26);
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.admin-plan-head {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 12px;
  align-items: center;
}

.admin-plan .pill {
  justify-self: end;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.admin-plan .pill.active {
  background: rgba(61, 214, 198, 0.16);
  color: #b9fff5;
}

.admin-plan .pill.inactive {
  background: rgba(244, 111, 93, 0.14);
  color: #f9b2a8;
}

.admin-plan-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.admin-plan-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-plan::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(240px 120px at 15% 0%, rgba(61, 214, 198, 0.18), transparent 70%);
  opacity: 0.8;
  pointer-events: none;
}

.admin-plan:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.32);
}

.admin-plan .value.price {
  font-size: 18px;
  font-weight: 700;
  color: #f6d488;
}

.admin-plan .value.mono {
  font-variant-numeric: tabular-nums;
}




.admin-user-head {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr auto;
  align-items: center;
  gap: 12px;
}

.admin-user-head .pill {
  justify-self: end;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(244, 185, 66, 0.18);
  color: #f6d488;
  font-size: 12px;
  font-weight: 600;
}

.admin-user-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-user .value.title {
  font-size: 16px;
}

.admin-user-meta .value {
  word-break: break-word;
  overflow-wrap: anywhere;
}


.admin-ticket {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 24, 26, 0.42);
  backdrop-filter: blur(8px);
  padding: 16px;
  display: grid;
  gap: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease, border-color 180ms ease;
}

.admin-ticket:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
}

.admin-ticket-head,
.admin-ticket-body {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-ticket-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-ticket .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.admin-ticket .value {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.admin-ticket .value.long {
  font-weight: 500;
  line-height: 1.5;
}

.admin-ticket-answer {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.admin-ticket-answer textarea {
  min-height: 68px;
  resize: vertical;
}

.admin-status {
  width: 100%;
}



.system-chart {
  position: relative;
}

.system-worker-chart {
  min-height: 180px;
}

.system-worker-chart svg {
  width: 100%;
  height: 180px;
  display: block;
}

.worker-line {
  fill: none;
  stroke-width: 2.4px;
  opacity: 0.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
}

.worker-axis {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1px;
}

.worker-grid {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1px;
}

.worker-label {
  fill: var(--muted);
  font-size: 10px;
}

.worker-line.receipt {
  stroke: rgba(61, 214, 198, 0.9);
  filter: none;
}

.worker-line.history {
  stroke: rgba(255, 194, 83, 0.92);
  filter: none;
}

.worker-line.history2 {
  stroke: rgba(140, 126, 255, 0.9);
  filter: none;
}

.system-chart-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.system-worker-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
}

.system-worker-controls select {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.system-worker-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.receipt {
  background: rgba(61, 214, 198, 0.9);
}

.legend-dot.history {
  background: rgba(255, 194, 83, 0.95);
}

.legend-dot.history2 {
  background: rgba(140, 126, 255, 0.9);
}

/* Chat Widget */
.chat-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ffdd8a);
  border: none;
  box-shadow: 0 8px 24px rgba(244, 185, 66, 0.4);
  color: #1b1b1b;
  font-size: 24px;
  cursor: pointer;
  z-index: 100;
  transition: transform 160ms ease, box-shadow 160ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toggle-mobile {
  display: none;
}

.is-mobile .chat-toggle {
  display: none !important;
}

.is-mobile .chat-toggle-mobile {
  display: grid;
}

.chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(244, 185, 66, 0.5);
}

.chat-toggle.has-new::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: #f46f5d;
  border: 2px solid #1b1b1b;
  border-radius: 50%;
}

.chat-widget {
  position: fixed;
  bottom: 96px;
  left: 24px;
  right: auto;
  width: 440px;
  height: 600px;
  max-height: calc(100vh - 96px);
  background: linear-gradient(160deg, rgba(17, 28, 28, 0.96), rgba(10, 18, 18, 0.96));
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise 240ms ease-out;
}

.chat-widget.chat-drop-active {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

.chat-history-list {
  display: grid;
  gap: 10px;
}

.chat-history-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 140ms ease, transform 140ms ease;
  text-align: left;
  font: inherit;
  appearance: none;
  position: relative;
}

.chat-history-item.active {
  border-color: rgba(244, 185, 66, 0.6);
  background: rgba(244, 185, 66, 0.12);
  color: #f7e7b9;
}

.chat-history-item.has-unread::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f46f5d;
  box-shadow: 0 0 0 2px rgba(27, 27, 27, 0.6);
}

.chat-history-item:hover {
  transform: translateY(-1px);
}

.chat-history-title {
  font-weight: 600;
  font-size: 12px;
}

.chat-history-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chat-history-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.chat-history-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #57d48a;
}

.chat-history-status.closed {
  color: #f5b0a6;
  border-color: rgba(244, 111, 93, 0.45);
  background: rgba(244, 111, 93, 0.12);
}

.chat-history-status.closed::before {
  background: #f46f5d;
}

.chat-header {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-back {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
}

.chat-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
}

.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.chat-history-view {
  display: grid;
  gap: 12px;
}

.chat-history-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.chat-start {
  width: 100%;
}

.chat-new-view {
  display: grid;
  gap: 12px;
}

.chat-new-field {
  display: grid;
  gap: 6px;
}

.chat-thread-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
  position: relative;
}

.chat-thread-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  padding: 0;
}

#active-chat-messages {
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 14px 12px;
  box-sizing: border-box;
  width: 100%;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.chat-scroll-hint {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.chat-thread-list::-webkit-scrollbar,
.chat-body::-webkit-scrollbar,
.admin-chat-body::-webkit-scrollbar,
.admin-chat-list::-webkit-scrollbar {
  width: 8px;
}

.chat-thread-list::-webkit-scrollbar-track,
.chat-body::-webkit-scrollbar-track,
.admin-chat-body::-webkit-scrollbar-track,
.admin-chat-list::-webkit-scrollbar-track {
  background: transparent;
}

.chat-thread-list::-webkit-scrollbar-thumb,
.chat-body::-webkit-scrollbar-thumb,
.admin-chat-body::-webkit-scrollbar-thumb,
.admin-chat-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}


.chat-type {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chat-new-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.chat-begin {
  height: 40px;
}

.chat-msg {
  max-width: 85%;
  width: fit-content;
  display: inline-flex;
  flex-direction: column;
  height: auto;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
  position: relative;
  box-sizing: border-box;
  align-items: flex-start;
}

.chat-msg-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-inline-code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
}

.chat-image-frame {
  margin-top: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.03);
  display: block;
  cursor: pointer;
  max-height: 400px;
  max-width: 100%;
  width: 100%;
  height: auto;
  overflow: hidden;
  line-height: 0;
}

.chat-msg.image-only .chat-image-frame {
  margin-top: 0;
}

.chat-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--accent);
}

.chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
}

.chat-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.chat-lightbox-img {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.chat-code-inline {
  margin: 6px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 12, 14, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.chat-code-inline code {
  font-family: inherit;
  white-space: pre-wrap;
}

.chat-msg-time {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.7;
}

.chat-msg-status {
  font-size: 12px;
  letter-spacing: -2px;
  line-height: 1;
}

.chat-msg-meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.chat-msg.them .chat-msg-meta {
  justify-content: flex-start;
}

.chat-msg-status.unread {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.chat-msg-status.read {
  color: #2de37b;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.chat-msg-edit {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 13px;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.chat-msg:hover .chat-msg-edit {
  opacity: 1;
  transform: scale(1.03);
}

.chat-msg-editor {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

.chat-msg-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.chat-msg-edit-save {
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  background: var(--accent);
  color: #1b1b1b;
  font-size: 12px;
  cursor: pointer;
}

.chat-msg-edit-cancel {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.chat-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 140px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(20, 22, 24, 0.96);
  border: 1px solid var(--panel-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-context-item {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.chat-context-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.chat-context-item.danger {
  color: #ff9f9f;
}

.chat-thread-list.long-pressing .chat-msg,
.chat-thread-list.long-pressing .chat-msg * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.chat-attach-menu {
  position: fixed;
  z-index: 1200;
  min-width: 140px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(20, 22, 24, 0.96);
  border: 1px solid var(--panel-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-attach-option {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-attach-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.chat-attach-option-meta {
  font-size: 10px;
  opacity: 0.7;
  white-space: nowrap;
}

.chat-file {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 38, 46, 0.65);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  width: fit-content;
  max-width: 320px;
}

.chat-file-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #fff;
}

.chat-file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-file-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-file-meta {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}

.admin-chat-body .chat-file {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 18px;
  gap: 8px;
  display: inline-flex;
  width: fit-content;
  max-width: 320px;
}

.admin-chat-body .chat-file-icon {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.admin-chat-body .chat-file-name {
  font-size: 12px;
}

.admin-chat-body .chat-file-meta {
  font-size: 10px;
}

.chat-msg.me .chat-msg-time {
  text-align: right;
}

.chat-msg.them .chat-msg-time {
  text-align: left;
}

.chat-msg.me {
  align-self: flex-end;
  margin-left: auto;
  background: linear-gradient(135deg, rgba(182, 140, 58, 0.88), rgba(140, 105, 36, 0.7));
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  border-bottom-right-radius: 2px;
  align-items: flex-end;
}

.chat-msg.them {
  align-self: flex-start;
  margin-right: auto;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  border-bottom-left-radius: 2px;
  align-items: flex-start;
}

.chat-msg.image-only {
  padding: 4px;
  width: auto;
  max-width: 85%;
}

.chat-msg.image-only .chat-msg-text {
  display: inline-flex;
  line-height: 0;
}

.chat-msg.image-only .chat-image-frame {
  display: block;
}

.chat-msg.image-only .chat-msg-meta {
  margin-top: 2px;
  gap: 4px;
}

.chat-msg.file-only {
  padding: 0 2px;
  width: auto;
  max-width: 100%;
  align-items: center;
}

.chat-msg.file-only .chat-file {
  margin-top: 0;
}

.chat-msg.file-only .chat-msg-meta {
  margin-top: 0;
  gap: 2px;
}

.admin-chat-body .chat-msg.file-only {
  align-items: center;
}

.chat-placeholder {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.chat-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}


.chat-attach-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-footer input,
.chat-footer textarea {
  flex: 1;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 12, 14, 0.7);
  color: var(--text);
  resize: none;
  min-height: 46px;
  max-height: 140px;
  overflow-y: auto;
  line-height: 1.4;
}

.admin-chat-footer textarea::-webkit-scrollbar,
.chat-footer textarea::-webkit-scrollbar {
  width: 6px;
}

.admin-chat-footer textarea::-webkit-scrollbar-track,
.chat-footer textarea::-webkit-scrollbar-track {
  background: transparent;
}

.admin-chat-footer textarea::-webkit-scrollbar-thumb,
.chat-footer textarea::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.chat-footer button:not(.chat-attach-btn) {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease;
}

.chat-footer button:hover {
  background: rgba(255, 255, 255, 0.15);
}



/* --- Mobile Responsive Fixes by Gemini --- */
:root[data-theme="light"] {
  --bg: #f5f7f8;
  --bg-spot: #dfe7ea;
  --panel: #ffffff;
  --panel-2: #f2f4f6;
  --panel-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(244, 246, 248, 0.98));
  --panel-border: rgba(14, 20, 20, 0.08);
  --hero-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(243, 245, 247, 0.98));
  --tabs-bg: rgba(255, 255, 255, 0.75);
  --tab-bg: rgba(0, 0, 0, 0.03);
  --tab-border: rgba(0, 0, 0, 0.12);
  --ghost-border: rgba(0, 0, 0, 0.15);
  --text: #0f1d1d;
  --muted: #4f6363;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .ghost {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.15);
  color: #0f1d1d;
}
:root[data-theme="light"] .ghost:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  outline: 1px solid rgba(0, 0, 0, 0.15);
}
:root[data-theme="light"] .history-filters,
:root[data-theme="light"] .reports-filters,
:root[data-theme="light"] .cart-card,
:root[data-theme="light"] .cart-panel,
:root[data-theme="light"] .modal-card,
:root[data-theme="light"] .modal-card-wide,
:root[data-theme="light"] .scanner-modal-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f1d1d;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .status-pill {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
  color: #2a3a3a;
}
:root[data-theme="light"] .status-pill.ok {
  border-color: rgba(28, 143, 131, 0.45);
  background: rgba(28, 143, 131, 0.16);
  color: #0f5750;
}
:root[data-theme="light"] .status-pill.issue {
  border-color: rgba(199, 54, 42, 0.45);
  background: rgba(199, 54, 42, 0.14);
  color: #8f1d16;
}
:root[data-theme="light"] .mobile-nav {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .mobile-tab:hover {
  background: rgba(0, 0, 0, 0.05);
}
:root[data-theme="light"] .mobile-menu {
  background: rgba(230, 234, 236, 0.65);
}

:root[data-theme="light"] .mobile-menu-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(244, 246, 248, 0.96));
  border-color: rgba(0, 0, 0, 0.12);
}

:root[data-theme="light"] .mobile-menu-item {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f1d1d;
}
:root[data-theme="brand"] {
  --bg: var(--brand-bg, #0f1418);
  --bg-spot: var(--brand-spot, #1b2230);
  --panel: rgba(18, 26, 32, 0.92);
  --panel-2: rgba(20, 30, 38, 0.92);
  --panel-bg: linear-gradient(160deg, rgba(18, 26, 32, 0.96), rgba(10, 18, 24, 0.96));
  --panel-border: rgba(255, 255, 255, 0.08);
  --hero-bg: linear-gradient(145deg, rgba(20, 28, 36, 0.96), rgba(10, 18, 24, 0.96));
  --tabs-bg: rgba(12, 18, 24, 0.85);
  --tab-bg: rgba(255, 255, 255, 0.04);
  --tab-border: rgba(255, 255, 255, 0.16);
  --ghost-border: rgba(255, 255, 255, 0.2);
  --accent: var(--brand-1, #4ee1a2);
  --accent-2: var(--brand-2, #6fb9ff);
  --text: #eef4f6;
  --muted: #aebbc2;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
}
:root[data-theme="brand"] .primary {
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--accent) 25%, #0f1418 75%),
    color-mix(in srgb, var(--accent-2) 25%, #0f1418 75%));
  color: #e7ecee;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}
:root[data-theme="brand"] .ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.12);
}
:root[data-theme="brand"] .tab.active {
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--accent) 22%, #10161a 78%),
    color-mix(in srgb, var(--accent-2) 22%, #10161a 78%));
  color: #e7ecee;
}
:root[data-theme="brand"] .plan-badge,
:root[data-theme="brand"] .metric-card.accent {
  filter: saturate(0.7) brightness(0.95);
}
:root[data-theme="brand"] .status {
  background: rgba(255, 255, 255, 0.06);
  color: #e7ecee;
}
:root[data-theme="brand"] .plan-badge,
:root[data-theme="brand"] .metric-card.accent {
  filter: saturate(0.85);
}
:root[data-theme="light"] .pricing-current {
  background: #f7f9fb;
  border-color: rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .plan-back {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(245, 247, 249, 0.96));
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .plan-back-grid > div {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .plan-card.active {
  box-shadow: 0 18px 30px rgba(78, 225, 162, 0.18);
}
:root[data-theme="light"] .plan-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .plan-card.featured {
  box-shadow: 0 22px 44px rgba(255, 196, 74, 0.22);
}
:root[data-theme="light"] .oneoff-item {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .settings-accountant-card {
  background: #f7f9fb;
  border-color: rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .settings-accountant-item {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .settings-card {
  background: #f7f9fb;
  border-color: rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .history-item {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .history-item:hover {
  box-shadow: 0 14px 24px rgba(15, 29, 29, 0.12);
}
:root[data-theme="light"] .support-form textarea,
:root[data-theme="light"] .support-form input,
:root[data-theme="light"] .support-form select {
  background: rgba(244, 246, 248, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
  color: #0f1416;
}
:root[data-theme="light"] .pdf-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .pdf-body {
  background: linear-gradient(180deg, rgba(240, 243, 246, 0.7), rgba(240, 243, 246, 0.4));
}
:root[data-theme="light"] .agreement-body,
:root[data-theme="light"] .cart-list,
:root[data-theme="light"] .notif-list,
:root[data-theme="light"] .report-table-wrap,
:root[data-theme="light"] .lead-modal-card .modal-body,
:root[data-theme="light"] .reports-modal-body {
  scrollbar-color: rgba(255, 150, 120, 0.8) rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .agreement-body::-webkit-scrollbar-track,
:root[data-theme="light"] .cart-list::-webkit-scrollbar-track,
:root[data-theme="light"] .notif-list::-webkit-scrollbar-track,
:root[data-theme="light"] .report-table-wrap::-webkit-scrollbar-track,
:root[data-theme="light"] .lead-modal-card .modal-body::-webkit-scrollbar-track,
:root[data-theme="light"] .reports-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
}
:root[data-theme="light"] .agreement-body::-webkit-scrollbar-thumb,
:root[data-theme="light"] .cart-list::-webkit-scrollbar-thumb,
:root[data-theme="light"] .notif-list::-webkit-scrollbar-thumb,
:root[data-theme="light"] .report-table-wrap::-webkit-scrollbar-thumb,
:root[data-theme="light"] .lead-modal-card .modal-body::-webkit-scrollbar-thumb,
:root[data-theme="light"] .reports-modal-body::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.9);
}
:root[data-theme="light"] .stock-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .stock-image {
  background: #f0f3f6;
}
:root[data-theme="light"] .stock-card.out {
  border-color: rgba(220, 60, 60, 0.8);
  box-shadow: 0 0 0 1px rgba(220, 60, 60, 0.12);
}
:root[data-theme="light"] .stock-card.out:hover {
  box-shadow: 0 16px 28px rgba(220, 60, 60, 0.18);
}
:root[data-theme="light"] .stock-card:hover {
  box-shadow: 0 16px 28px rgba(15, 29, 29, 0.12);
}
:root[data-theme="light"] .cart-panel {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .cart-item {
  background: #f7f9fb;
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .cart-total {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .cart-list .placeholder {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
}
:root[data-theme="light"] .profile-card.alt {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .profile-left,
:root[data-theme="light"] .profile-id,
:root[data-theme="light"] .metric-card {
  background: #f7f9fb;
  border-color: rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .metric-card.accent {
  background: linear-gradient(140deg, rgba(255, 220, 140, 0.55), rgba(200, 247, 236, 0.6));
}
:root[data-theme="light"] .profile-upload {
  background: #f7f9fb;
  border-color: rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .profile-history {
  background: #f7f9fb;
  border-color: rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .profile-accountant-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .profile-history-row {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .admin-leads-summary-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .admin-leads-kpi {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .admin-lead {
  background: linear-gradient(150deg, rgba(251, 253, 255, 0.96), rgba(241, 246, 248, 0.9));
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] .admin-lead-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .admin-lead::before {
  background: radial-gradient(240px 120px at 10% 0%, rgba(61, 214, 198, 0.1), transparent 70%);
}
:root[data-theme="light"] .system-card,
:root[data-theme="light"] .system-panel,
:root[data-theme="light"] .system-action {
  background: linear-gradient(150deg, rgba(251, 253, 255, 0.96), rgba(242, 246, 248, 0.9));
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] .system-card::before,
:root[data-theme="light"] .system-panel::before,
:root[data-theme="light"] .system-action::before {
  background: radial-gradient(200px 120px at 10% 0%, rgba(61, 214, 198, 0.1), transparent 70%);
}
:root[data-theme="light"] .admin-user {
  background: linear-gradient(150deg, rgba(251, 253, 255, 0.96), rgba(241, 246, 248, 0.9));
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] .admin-user::before {
  background: radial-gradient(260px 130px at 10% 0%, rgba(244, 185, 66, 0.12), transparent 70%);
}
:root[data-theme="light"] .admin-plan {
  background: linear-gradient(145deg, rgba(251, 253, 255, 0.95), rgba(240, 245, 248, 0.9));
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] .admin-plan::before {
  background: radial-gradient(240px 120px at 15% 0%, rgba(61, 214, 198, 0.12), transparent 70%);
}
:root[data-theme="light"] .admin-ticket {
  background: rgba(247, 249, 251, 0.75);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}
:root[data-theme="light"] .chat-widget {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}
:root[data-theme="light"] .chat-header,
:root[data-theme="light"] .chat-footer {
  background: #f7f9fb;
  border-color: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .chat-msg.them {
  background: #f0f3f6;
  color: #0f1d1d;
}
@media (max-width: 720px) {
  .notif-panel {
    position: fixed;
    right: 12px;
    left: auto;
    max-width: 90vw;
  }
}
@media (max-width: 900px) {
  .lead-form {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 980px) {
  .history-filters {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}
@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .cart-layout {
    height: auto;
    align-items: stretch;
  }

  .cart-panel,
  .cart-items,
  .cart-checkout {
    flex: 0 0 auto;
  }

  .cart-item {
    gap: 8px;
    min-height: 128px;
    align-content: start;
    padding: 16px;
  }

  .cart-panel {
    width: 100%;
  }

  .cart-item > div {
    align-items: start;
  }

  .cart-item > div:first-child,
  .cart-item > div:last-child {
    grid-column: 1 / -1;
  }

  .cart-item > div:first-child .value {
    white-space: normal;
  }

  .cart-item > div:last-child {
    justify-items: end;
  }

  .cart-item input {
    width: 100%;
    max-width: 100%;
  }
}
@media (max-width: 720px) {
  .history-item {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "date date"
      "receipt fiscal"
      "total type"
      "actions actions";
  }
  .history-item > div:nth-child(1) {
    grid-area: date;
  }
  .history-item > div:nth-child(2) {
    grid-area: receipt;
  }
  .history-item > div:nth-child(3) {
    grid-area: fiscal;
  }
  .history-item > div:nth-child(4) {
    grid-area: total;
  }
  .history-item > div:nth-child(5) {
    grid-area: type;
  }
  .history-item > div:nth-child(6) {
    grid-area: actions;
  }
}
@media (max-width: 720px) {
  .profile-card.alt {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .actions {
    width: 100%;
  }
  .user-card {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 900px) {
  .app {
    padding: 36px 18px 120px;
  }
  .logo {
    width: 110px;
    height: 110px;
  }
  .tabs-fixed {
    padding: 6px 10px;
  }
  .tabs-fixed {
    display: none;
  }
  .hero-actions {
    gap: 8px;
  }
  .logout-btn {
    width: 120px;
  }

  .admin-chat {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .admin-chat-list {
    height: 220px;
    max-height: 220px;
  }

  .admin-chat-window {
    height: 60vh;
    max-height: 60vh;
  }
}
@media (max-width: 720px) {
  :root {
    --tabs-height: 54px;
    --fixed-gap: 6px;
  }

  .app {
    padding: 28px 14px 120px;
  }

  .hero-top {
    flex-direction: row;
    align-items: center;
  }

  .hero-actions {
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .brand {
    width: auto;
    align-items: center;
    gap: 10px;
  }

  .logo {
    width: 44px;
    height: 44px;
    display: none;
  }

  .brand-text h1 {
    font-size: 18px;
    line-height: 32px;
  }

  .brand-sub {
    display: none;
  }

  .tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    justify-content: flex-start;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    width: 140px;
    height: 44px;
    flex: 0 0 auto;
  }

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

  .primary,
  .ghost {
    width: 100%;
  }

  .plan-change-otp .ghost {
    width: auto;
  }

  .hero-actions .lang-select {
    width: auto;
    min-width: 0;
  }

  .lang-switch {
    padding: 2px 4px;
  }

  .settings-support-bar {
    flex-direction: column;
    align-items: stretch;
  }

  #support-open {
    order: 1;
  }

  #support-history-toggle {
    order: 2;
  }

  .hero-compact .ghost,
  .hero-compact .logout-btn,
  .hero-compact .theme-toggle {
    width: auto;
    min-width: 92px;
  }

  .hero-compact .hero-actions {
    width: auto;
    flex-wrap: nowrap;
  }

  .profile-card.alt {
    grid-template-columns: 1fr;
  }

  .profile-right {
    grid-template-columns: 1fr;
  }

  .profile-upload {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-history-head,
  .profile-history-row {
    grid-template-columns: 1fr;
  }

  .profile-plan-history .profile-history-head,
  .profile-plan-history .profile-history-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "change change"
      "when by";
  }

  .profile-plan-history .profile-history-head > div:nth-child(1),
  .profile-plan-history .profile-history-row > div:nth-child(1) {
    grid-area: change;
  }

  .profile-plan-history .profile-history-head > div:nth-child(2),
  .profile-plan-history .profile-history-row > div:nth-child(2) {
    grid-area: when;
  }

  .profile-plan-history .profile-history-head > div:nth-child(3),
  .profile-plan-history .profile-history-row > div:nth-child(3) {
    grid-area: by;
  }

  .history-filters label {
    width: 100%;
  }

  .history-filters select,
  .history-filters input[type="date"],
  .history-filters input[type="number"] {
    width: 100%;
    min-width: 0;
  }

  .history-filters,
  .reports-filters,
  .reports-kpis,
  .reports-grid,
  .cart-layout,
  .profile-id-grid,
  .status-grid,
  .system-grid,
  .admin-leads-summary-card,
  .admin-leads-actions,
  .admin-leads-toolbar {
    display: flex;
    flex-direction: column;
  }

  .cart-payments {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .cart-payments input {
    width: 100%;
    min-width: 0;
  }

  .settings-matrix {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .settings-col-bg {
    display: none;
  }

  .settings-cell,
  .settings-head,
  .settings-actions {
    grid-column: 1;
  }

  .col-2,
  .col-3 {
    grid-column: 1;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .history-actions-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .history-actions-group {
    display: contents;
    gap: 0;
  }

  .history-actions {
    grid-template-columns: 1fr;
  }

  .action-btn:not(.cart-remove) {
    width: 100%;
  }

  .cart-item {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    min-height: 0;
  }

  .cart-item .cart-remove {
    width: 32px;
    height: 32px;
  }

  .cart-list {
    max-height: 45vh;
  }

  .cart-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pdf-actions {
    width: 100%;
    justify-content: space-between;
  }

  .pdf-actions .modal-close {
    width: 40px;
    height: 40px;
  }

  .settings-matrix .row-1,
  .settings-matrix .row-2,
  .settings-matrix .row-3,
  .settings-matrix .row-4,
  .settings-matrix .row-5 {
    grid-row: auto;
  }

  .stock-list {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .stock-card {
    min-height: 240px;
  }

  .stock-image {
    height: 120px;
  }

  .modal-card {
    padding: 14px;
  }

  .modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

.modal-actions {
  flex-direction: column;
  align-items: stretch;
}
}
@media (max-width: 1200px) {
  .admin-leads-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-leads-actions {
    justify-content: flex-start;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
@media (max-width: 900px) {
  .admin-leads-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-leads-summary-card {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .admin-leads-actions {
    justify-content: flex-start;
  }
}
@media (max-width: 900px) {
  .admin-lead-cards,
  .admin-lead-actions {
    grid-template-columns: 1fr;
  }

  .admin-lead-buttons {
    flex-wrap: wrap;
  }

  .admin-lead-inline.grow {
    grid-column: auto;
  }
}
@media (max-width: 900px) {
  .system-columns {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .admin-plan-head,
  .admin-plan-meta {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .admin-user {
    grid-template-columns: 1fr;
  }

  .admin-user-head,
  .admin-user-meta {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .admin-ticket-head,
  .admin-ticket-body {
    grid-template-columns: 1fr;
  }

  .admin-ticket-answer {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .logo {
    width: 84px;
    height: 84px;
  }

  .history-item {
    gap: 8px;
  }

  .modal-card-wide {
    height: 86vh;
  }

  .scanner-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .scanner-actions .ghost,
  .scanner-actions .primary {
    width: 100%;
  }

  .reports-filters {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {

  /* 1. Ուղղում ենք կողային մենյուի կոճակները, որ դուրս չգան (image 1) */
  .hero-actions {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 6px !important;
    width: auto !important;
  }

  .logout-btn, .theme-toggle, .lang-switch {
    width: auto !important;
    min-width: 0 !important;
    justify-content: center;
  }

  /* 2. Password և Input դաշտերի ադապտացիա (image 2) */
  .grid, .login-form {
    grid-template-columns: 1fr !important; /* Ամեն ինչ դառնում է 1 սյունակ */
  }

  input, select, textarea {
    width: 100% !important;
    font-size: 16px !important; /* Որպեսզի iOS-ը չզում անի input-ի վրա */
  }

  /* 3. Header-ի գործողությունները (Receipt Open + History) (image 3) */
  .panel-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px;
  }

  .history-filters {
    grid-template-columns: 1fr !important;
    position: relative !important; /* Հեռախոսի վրա sticky-ն հանում ենք, որ տեղ ազատվի */
    top: 0 !important;
  }

  /* 4. Աղյուսակների (Receipt Items) սեղմում (image 4 & 5) */
  .report-table-head, .report-row {
    grid-template-columns: 1fr 1fr !important; /* Միայն կարևոր սյունակները */
    font-size: 12px;
  }

  .report-table-head--details, .report-row--details {
    display: flex !important;
    flex-direction: column;
    border-bottom: 1px solid var(--panel-border);
  }

  .report-row > div {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  /* 5. Կոճակների չափսերը հեռախոսի համար */
  .primary:not(.action-btn), .ghost:not(.action-btn), .tab {
    width: 100% !important;
    height: 48px !important; /* Մատով սեղմելու համար ավելի հարմար */
  }

  /* Տաբերը սարքում ենք հորիզոնական սքրոլով */
  .tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

.tab {
  flex: 0 0 auto !important;
  width: 140px !important;
}
}
@media (max-width: 720px) {
  .history-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .history-actions-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
  }

  .history-actions-group {
    display: contents;
  }

  .history-filters .history-actions-row .action-btn,
  .history-filters .history-actions-group .action-btn {
    width: auto;
  }

  #stock-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  #stock-form label {
    display: grid;
    gap: 8px;
  }

  #stock-form label.full,
  #stock-form .stock-form-actions {
    grid-column: 1 / -1;
  }

  .cart-list {
    overflow-y: auto;
  }

  .chat-widget {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .chat-side {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
  }

  .chat-history-list {
    display: grid;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
  }

  .chat-history-item {
    width: 100%;
    min-width: 0;
  }

  .chat-header {
    padding: 16px;
  }

  .chat-body {
    padding: 16px;
  }

  .chat-footer {
    padding: 12px 16px 16px;
  }

  .cart-list .cart-item {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    min-height: 128px;
    align-content: start;
  }

  .modal-card,
  .modal-card-wide,
  .scanner-modal-card {
    max-height: 90vh;
  }

  .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-header {
    align-items: flex-start;
    gap: 8px;
  }

  .modal-header .modal-close {
    align-self: flex-end;
  }

  input,
  select,
  textarea {
    width: 100%;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto;
  }

  .plan-change-modal-card .upgrade-consent {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .plan-change-modal-card .upgrade-consent span {
    line-height: 1.45;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .plan-change-modal-card .plan-change-otp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .plan-change-modal-card .plan-change-otp input {
    width: 100% !important;
    min-height: 44px;
    font-size: 17px;
    letter-spacing: 0.08em;
  }

  .plan-change-modal-card .plan-change-otp .ghost {
    width: auto !important;
    min-width: 112px;
    height: 44px !important;
    padding: 0 10px;
    font-size: 12px;
  }
}

@media (max-width: 430px) {
  .plan-change-modal-card {
    width: 96vw;
    padding: 12px;
  }

  .plan-change-modal-card .upgrade-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }

  .plan-change-modal-card .upgrade-consent span {
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
  }

  .plan-change-modal-card .plan-change-otp {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .plan-change-modal-card .plan-change-otp input {
    min-height: 42px;
    font-size: 16px;
    padding: 10px 10px;
  }

  .plan-change-modal-card .plan-change-otp .ghost {
    min-width: 96px;
    height: 42px !important;
    padding: 0 8px;
    font-size: 11px;
  }
}
