@font-face {
  font-family: "Rabar";
  src: url("../fonts/Rabar_013.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Rabar";
  src: url("../fonts/Rabar_015.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #eef2f4;
  --card: #ffffff;
  --ink: #12262e;
  --muted: #64748b;
  --line: #e2e8f0;
  --teal: #0f766e;
  --teal-2: #14b8a6;
  --teal-soft: #ecfdf8;
  --shadow: 0 8px 24px rgba(15, 40, 50, 0.07);
  --shadow-sm: 0 2px 8px rgba(15, 40, 50, 0.04);
  --radius: 14px;
  --font: "Rabar", system-ui, sans-serif;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }

.hidden { display: none !important; }
.muted { color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.58rem 1rem;
  cursor: pointer;
  background: transparent;
  transition: 0.15s ease;
  font-weight: 500;
}

.btn-primary {
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover { filter: brightness(1.06); }

.btn-soft {
  background: var(--teal-soft);
  color: var(--teal);
  border-color: #cceee8;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--muted);
  background: #fff;
}

.btn-ghost:hover {
  border-color: #cbd5e1;
  color: var(--ink);
}

.btn-light {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
}

.btn-soft-action,
.btn-hide,
.btn-danger {
  border-radius: 8px;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.88rem;
}

.btn-soft-action { color: var(--teal); }
.btn-soft-action:hover { background: var(--teal-soft); border-color: #b7e5dc; }
.btn-hide { color: #92400e; border-color: #fde68a; }
.btn-hide:hover { background: #fffbeb; }
.btn-danger { color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-vip-slide {
  border-radius: 8px;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
  border: 1px solid #c5d0d8;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #64748b;
}
.btn-vip-slide:hover {
  border-color: #b7e5dc;
  background: var(--teal-soft);
  color: var(--teal);
}
.btn-vip-slide.is-on {
  background: linear-gradient(135deg, #d4f34a, #b8e62e);
  border-color: #a3d41f;
  color: #14301a;
  box-shadow: 0 2px 8px rgba(180, 220, 40, 0.35);
}
.row-hidden { opacity: 0.55; }
.badge-hidden { background: #fff7ed; color: #9a3412; }

/* Login */
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(800px 360px at 100% 0%, rgba(20, 184, 166, 0.14), transparent 55%),
    radial-gradient(600px 280px at 0% 100%, rgba(15, 118, 110, 0.08), transparent 50%),
    var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 1.15rem 0 0.35rem;
  font-size: 1.65rem;
}

.login-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.login-form label,
.editor-fields label {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-form input,
.search,
.editor-fields input,
.editor-fields select,
.editor-fields textarea {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  outline: none;
}

.login-form input:focus,
.search:focus {
  border-color: var(--teal-2);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}
.editor-fields label.full { grid-column: 1 / -1; }
.editor-fields textarea {
  min-height: 72px;
  resize: vertical;
}
.editor-fields input:focus,
.editor-fields select:focus,
.editor-fields textarea:focus {
  border-color: var(--teal-2);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.error { color: #b91c1c; margin: 0; }
.hint { margin: 0; color: #94a3b8; font-size: 0.84rem; }

/* App shell */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 1rem;
  min-height: 100vh;
  padding: 1rem;
  align-items: start;
}

.sidebar {
  padding: 0.9rem 0.7rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: sticky;
  top: 1rem;
  height: calc(100vh - 2rem);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar-brand,
.logo-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.45rem 0.85rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #0f766e, #14b8a6);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.22);
}

.logo-name {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.logo-sub {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-inline: 0.15rem;
  scrollbar-width: thin;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: start;
  border: 0;
  background: transparent;
  color: #5b6b76;
  padding: 0.55rem 0.55rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}

.nav-ico-wrap {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #f1f5f7;
  color: #64748b;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-ico {
  width: 17px;
  height: 17px;
  opacity: 1;
  flex-shrink: 0;
}

.nav-num { display: none; }

.nav-item:hover {
  background: #f7fafb;
  color: var(--ink);
}

.nav-item:hover .nav-ico-wrap {
  background: #e8eef1;
  color: var(--ink);
}

.nav-item.active {
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: var(--teal);
}

.nav-item.active .nav-ico-wrap {
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-group .nav-chevron {
  margin-inline-start: auto;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.15s ease;
}

.nav-group.is-open .nav-chevron {
  transform: rotate(180deg);
  color: var(--teal);
}

.nav-group .nav-item.active .nav-chevron {
  color: var(--teal);
}

.nav-sub {
  display: none;
  flex-direction: column;
  gap: 0.12rem;
  margin: 0.1rem 0 0.35rem;
  padding: 0.2rem 0.2rem 0.2rem 0.55rem;
  margin-inline-start: 1.05rem;
  border-inline-start: 1px solid #dbe4ea;
}

.nav-group.is-open .nav-sub {
  display: flex;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: start;
  border: 0;
  background: transparent;
  color: #6b7c88;
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-sub-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c5d0d8;
  flex-shrink: 0;
}

.nav-sub-item:hover {
  background: #f4f7f8;
  color: var(--ink);
}

.nav-sub-item:hover .nav-sub-dot {
  background: #94a3b8;
}

.nav-sub-item.active {
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal);
  font-weight: 700;
}

.nav-sub-item.active .nav-sub-dot {
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.nav-sub-item.manage {
  margin-top: 0.25rem;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(15, 118, 110, 0.14);
  font-weight: 600;
}

.nav-sub-item.manage:hover {
  background: #d9f5ef;
  border-color: rgba(15, 118, 110, 0.28);
  color: var(--teal);
}

.nav-sub-plus {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.12);
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}

.color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(15, 40, 50, 0.12);
  vertical-align: middle;
  margin-inline-end: 0.35rem;
}

.color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-inline-start: 0.35rem;
}

.sidebar-foot {
  flex-shrink: 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.logout-btn {
  width: 100%;
  justify-content: center;
  border-radius: 10px;
  color: #64748b;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  box-shadow: var(--shadow-sm);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem 0.25rem 0.25rem;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
  font-size: 0.85rem;
}

.lang-switch {
  display: flex;
  gap: 0.2rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.88rem;
}

.lang-btn.active {
  background: #fff;
  color: var(--teal);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.hero {
  border-radius: 18px;
  padding: 1.25rem 1.4rem;
  background:
    radial-gradient(420px 160px at 85% 0%, rgba(255,255,255,0.2), transparent 55%),
    linear-gradient(115deg, #0b3f3d 0%, #0f766e 48%, #0ea5a4 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1rem;
  box-shadow: 0 14px 32px rgba(15, 118, 110, 0.22);
  min-height: 118px;
}

.hero.is-pending-mode {
  align-items: stretch;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  height: auto;
  padding: 1rem 1.15rem;
  gap: 0.65rem;
}

.hero-brand {
  flex: 1;
  min-width: 0;
}

.hero-kicker {
  margin: 0;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  opacity: 0.78;
  font-weight: 500;
}

.hero h1 {
  margin: 0.35rem 0 0.25rem;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 700;
}

.hero-date {
  margin: 0;
  opacity: 0.88;
  font-size: 0.92rem;
}

.hero-pending {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hero-pending.hidden {
  display: none;
}

.hero-pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.hero-pending-head h2 {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.hero-pending-count {
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
}

.hero-pending-count.is-pulse {
  animation: heroPulse 1.2s ease-out 2;
}

@keyframes heroPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 230, 120, 0.7); transform: scale(1); }
  40% { box-shadow: 0 0 0 10px rgba(255, 230, 120, 0); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 0 rgba(255, 230, 120, 0); transform: scale(1); }
}

.hero-pending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  /* Grow with items only — no empty tall box */
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.hero-pending-list.has-items {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.hero-pending-list.is-scrollable {
  max-height: 22rem;
  overflow: auto;
  padding-inline-end: 0.15rem;
}

.hero-pending-list li {
  margin: 0;
}

.hero-pending-item {
  width: 100%;
  text-align: start;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  border-radius: 11px;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hero-pending-item:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.38);
}

.hero-pending-item.is-new {
  border-color: rgba(255, 230, 120, 0.6);
  background: rgba(255, 230, 120, 0.14);
}

.hero-pending-item-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.hero-pending-item-main strong {
  font-size: 0.92rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-pending-item-main span {
  font-size: 0.75rem;
  opacity: 0.85;
}

.hero-pending-item-amount {
  font-weight: 900;
  font-size: 0.9rem;
  white-space: nowrap;
}

.hero-pending-empty {
  margin: 0;
  opacity: 0.88;
  font-size: 0.9rem;
  padding: 0.35rem 0;
}

.hero-pending-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.hero-pending-live {
  font-size: 0.75rem;
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-pending-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b8f06a;
  box-shadow: 0 0 0 3px rgba(184, 240, 106, 0.22);
}

.hero-pending-all {
  align-self: flex-start;
  padding: 0.4rem 0.85rem !important;
  font-size: 0.85rem !important;
}

/* Stats — force grid */
#stats.stats-grid,
.stats-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.stat-card {
  position: relative;
  padding: 1rem 1.05rem 1rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 118px;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--teal), var(--teal-2));
}

.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.stat-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal);
  flex-shrink: 0;
}

.stat-ico svg {
  width: 18px;
  height: 18px;
}

.stat-card .label {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-card .value {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-card .meta {
  margin: 0;
  color: #94a3b8;
  font-size: 0.8rem;
}

.charts-grid,
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.85rem;
}

.bottom-grid {
  grid-template-columns: 1.25fr 1fr;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.1rem 0.35rem;
}

.card-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.chart-body {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0.5rem;
  padding: 0.35rem 1rem 1rem;
  align-items: center;
}

.chart-canvas-wrap {
  height: 220px;
  position: relative;
}

.chart-body-line {
  grid-template-columns: 1fr;
}

.chart-body-line .chart-canvas-wrap {
  height: 240px;
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0.2rem 0;
  display: grid;
  gap: 0.5rem;
}

.legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: #f8fafc;
}

.legend li strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-inline-end: 0.4rem;
}

.activity,
.city-list {
  list-style: none;
  margin: 0;
  padding: 0.2rem 0 0.7rem;
}

.activity li,
.city-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid #f1f5f9;
  color: var(--ink);
  font-size: 0.92rem;
}

.activity li span:last-child,
.city-list li span:last-child {
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.84rem;
}

.toolbar {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search { max-width: 340px; }

.table-wrap { overflow: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: start;
  border-bottom: 1px solid #f1f5f9;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.84rem;
  background: #f8fafc;
}

.thumb {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 9px;
  margin-inline-end: 0.55rem;
  vertical-align: middle;
}

.row-title {
  display: inline-flex;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 600;
}

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

.mini-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.mini-stats .stat-card {
  min-height: 96px;
}

.badge-paid { background: #ecfdf5; color: #047857; }
.badge-approved { background: #ecfdf5; color: #047857; }
.badge-pending { background: #fff7ed; color: #c2410c; }
.badge-rejected { background: #fef2f2; color: #b91c1c; }
.badge-delivery { background: #eff6ff; color: #1d4ed8; }
.badge-refunded { background: #f1f5f9; color: #475569; }
.badge-cancelled { background: #fef2f2; color: #b91c1c; }
.badge-active { background: #ecfdf8; color: #0f766e; }
.badge-blocked { background: #fef2f2; color: #b91c1c; }
.badge-pay-fib { background: #ecfeff; color: #0e7490; }
.badge-pay-qi { background: #f5f3ff; color: #6d28d9; }
.badge-pay-cash { background: #f8fafc; color: #475569; }
.badge-pay-none { background: #f1f5f9; color: #94a3b8; }

.receipt-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--teal, #0f766e);
  font-weight: 700;
  font-size: 0.85rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.receipt-link:hover { opacity: 0.85; }
.receipt-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.muted-note {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
  margin-inline-end: 8px;
}

/* —— Receipt / invoice review modal —— */
.receipt-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(560px, calc(100vw - 32px));
  width: 100%;
  border-radius: 22px;
}
.receipt-modal::backdrop {
  background: rgba(10, 22, 28, 0.62);
  backdrop-filter: blur(6px);
}
.receipt-sheet {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 820px);
}
.receipt-sheet-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 52px 20px 22px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(212, 255, 90, 0.14), transparent 55%),
    linear-gradient(135deg, #0f1c22 0%, #1a3038 55%, #12262e 100%);
  color: #fff;
}
.receipt-sheet-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.55;
}
.receipt-sheet-who h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.3;
}
.receipt-sheet-meta {
  margin: 8px 0 0;
  font-size: 0.82rem;
  opacity: 0.72;
  line-height: 1.45;
}
.receipt-sheet-amount-wrap {
  text-align: start;
  flex-shrink: 0;
}
.receipt-sheet-amount {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 900;
  color: #d4ff5a;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.receipt-method-chip {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(212, 255, 90, 0.16);
  color: #d4ff5a;
  font-size: 0.75rem;
  font-weight: 800;
}
.receipt-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.receipt-close:hover { background: rgba(255, 255, 255, 0.18); }
.receipt-sheet-body {
  padding: 18px;
  background: #f4f6f8;
  overflow: auto;
  flex: 1;
}
.receipt-image-frame {
  position: relative;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(15, 40, 50, 0.06);
}
.receipt-image-frame img {
  display: block;
  max-width: 100%;
  max-height: min(52vh, 480px);
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}
.receipt-image-frame.is-empty img { display: none; }
.receipt-image-empty {
  display: none;
  margin: 0;
  color: #b91c1c;
  font-weight: 800;
  font-size: 1.1rem;
}
.receipt-image-frame.is-empty .receipt-image-empty { display: block; }
.receipt-sheet-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 18px 18px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.receipt-sheet-foot:empty { display: none; }
.receipt-sheet-foot .btn-receipt-reject,
.receipt-sheet-foot .btn-receipt-approve {
  height: 52px;
  border-radius: 14px;
  border: none;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}
.receipt-sheet-foot .btn-receipt-reject {
  background: #fee2e2;
  color: #b91c1c;
}
.receipt-sheet-foot .btn-receipt-reject:hover { background: #fecaca; }
.receipt-sheet-foot .btn-receipt-approve {
  background: var(--teal);
  color: #fff;
}
.receipt-sheet-foot .btn-receipt-approve:hover { background: #0d9488; }
.receipt-sheet-foot .btn-receipt-done {
  grid-column: 1 / -1;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
  font-family: inherit;
}
@media (max-width: 520px) {
  .receipt-sheet-head {
    flex-direction: column;
    padding-inline-end: 48px;
  }
  .receipt-sheet-amount { font-size: 1.25rem; }
}

.finance-box {
  padding: 0.4rem 1.1rem 1.15rem;
  display: grid;
  gap: 0.85rem;
  max-width: 360px;
}

.finance-box.finance-rates {
  max-width: 100%;
}

.commission-rates-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .commission-rates-grid {
    grid-template-columns: 1fr;
  }
}

.finance-box label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

/* Phone / account numbers must stay LTR inside RTL admin */
.ltr-num,
input.ltr-num,
#fib-account,
#qi-account {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
}

.finance-box input {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

@media (max-width: 1200px) {
  .mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.editor {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(520px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  box-shadow: 0 24px 60px rgba(15, 40, 50, 0.18);
  overflow: hidden;
}
.editor.editor-wide {
  width: min(960px, calc(100vw - 2rem));
  max-width: none;
  height: auto;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}

.editor::backdrop { background: rgba(15, 35, 42, 0.4); }
.editor-form {
  padding: 1rem 1.15rem 0.85rem;
  box-sizing: border-box;
  max-height: inherit;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.editor.editor-wide .editor-form {
  height: min(860px, calc(100vh - 2rem));
}
.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}
.editor-head h2 {
  margin: 0;
  font-size: 1.15rem;
}
.icon-btn {
  border: 0;
  background: transparent;
  font-size: 1.45rem;
  cursor: pointer;
  color: var(--muted);
}
.editor-fields {
  display: grid;
  gap: 0.55rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 0.35rem;
  align-content: start;
}
.editor.editor-wide .editor-fields {
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
}
.editor.editor-wide .editor-fields > label {
  margin: 0;
}
.editor.editor-wide .editor-fields > label span {
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}
.editor.editor-wide .editor-fields > label input,
.editor.editor-wide .editor-fields > label select {
  padding: 0.48rem 0.65rem;
  font-size: 0.88rem;
}
/* Full-width blocks inside event editor */
.editor.editor-wide .editor-fields > #hall-layout-fields,
.editor.editor-wide .editor-fields > #restaurant-layout-fields,
.editor.editor-wide .editor-fields > .seat-editor,
.editor.editor-wide .editor-fields > .floor-editor,
.editor.editor-wide .editor-fields > .lessons-editor,
.editor.editor-wide .editor-fields > .attrs-editor,
.editor.editor-wide .editor-fields > .product-attrs,
.editor.editor-wide .editor-fields > .icon-upload,
.editor.editor-wide .editor-fields > .form-section {
  grid-column: 1 / -1;
}
.editor.editor-wide .floor-editor {
  display: flex;
  flex-direction: column;
  min-height: 380px;
  margin-top: 0.25rem;
}
.editor.editor-wide .floor-canvas-wrap {
  flex: 1;
  min-height: 300px;
}
.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0;
  padding: 0.75rem 0 0.15rem;
  border-top: 1px solid var(--line, #e5e9ec);
  background: #fff;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 5;
}

.seat-editor {
  border: 1px solid var(--line, #dce3e7);
  border-radius: 14px;
  padding: 0.85rem;
  background: #f7f9fa;
}
.seat-editor-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.55rem;
}
.seat-editor-head strong { font-size: 0.92rem; }
.seat-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.seat-tool {
  border: 1px solid #c9d2d8;
  background: #fff;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  color: #1c1f26;
}
.seat-tool.active {
  background: #1c1f26;
  border-color: #1c1f26;
  color: #d4f34a;
}
.seat-editor-hint {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.seat-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin-bottom: 0.65rem;
  border-radius: 10px;
  background: linear-gradient(180deg, #2a2d35, #1c1f26);
  color: #d4f34a;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.seat-grid {
  display: grid;
  gap: 6px;
  direction: rtl;
}
.seat-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid #c9d2d8;
  background: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  color: #1c1f26;
}
.seat-cell.vip {
  background: rgba(212, 243, 74, 0.35);
  border-color: #b7d63a;
}
.seat-cell.reserved {
  background: #d7dadf !important;
  border-color: #d7dadf !important;
  color: #6b7280;
}
.seat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.7rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.seat-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.seat-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid #c9d2d8;
  display: inline-block;
}
.seat-swatch.vip { background: rgba(212, 243, 74, 0.45); border-color: #b7d63a; }
.seat-swatch.normal { background: #fff; }
.seat-swatch.reserved { background: #d7dadf; border-color: #d7dadf; }

.floor-editor {
  border: 1px solid var(--line, #dce3e7);
  border-radius: 14px;
  padding: 0.85rem;
  background: #f7f9fa;
  margin-top: 0.5rem;
}
.floor-editor-head {
  margin-bottom: 0.65rem;
}
.floor-table-palette {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}
.floor-table-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.4rem 0.55rem;
  border: 1.5px solid #c9d2d8;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  color: #1c1f26;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.floor-table-pick:hover {
  border-color: #1c1f26;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.floor-table-pick span:not(.iso-table-img-wrap):not(.iso-table-badge) {
  font-size: 0.72rem;
  font-weight: 700;
}
.floor-table-pick .iso-table-img-wrap {
  width: 92px !important;
  height: 92px !important;
  background: transparent;
  border-radius: 0;
  padding: 4px;
  box-sizing: border-box;
  box-shadow: none;
}
.topdown-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.iso-table-img-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-sizing: border-box;
  box-shadow: none;
}
.iso-table-img-wrap.topdown-table {
  background: transparent;
  box-shadow: none;
}
.iso-table-img-wrap.vip {
  background: transparent;
  box-shadow: none;
  filter: none;
}
.iso-table-img-wrap.vip .topdown-svg {
  /* VIP tint via stroke already in SVG */
}
.iso-table-img-wrap.reserved {
  opacity: 0.4;
  filter: grayscale(0.35);
}
.iso-table-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}
.floor-meter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem 1rem;
  margin: 0.35rem 0 0.65rem;
  padding: 0.55rem 0.7rem;
  background: #fff;
  border: 1px solid #e4e8ec;
  border-radius: 12px;
}
.floor-meter-field {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.floor-meter-field input {
  width: 5.5rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid #c9d2d8;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1c1f26;
}
.floor-meter-info {
  margin-inline-start: auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4b5563;
  align-self: center;
}
.floor-canvas-wrap {
  overflow: auto;
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid #e4e8ec;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.07) 1px, transparent 1px) 0 0 / var(--floor-m, 48px) var(--floor-m, 48px),
    linear-gradient(rgba(0, 0, 0, 0.07) 1px, transparent 1px) 0 0 / var(--floor-m, 48px) var(--floor-m, 48px),
    #eef2f4;
}
.floor-canvas {
  position: relative;
  margin: 0;
  width: 100%;
  touch-action: none;
  user-select: none;
  background: transparent;
  box-sizing: border-box;
  overflow: visible;
}
.floor-item {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: grab;
  box-sizing: border-box;
  border: 1.5px solid #1c1f26;
  color: #1c1f26;
  background: #fff;
}
.floor-item.type-stage {
  background: transparent;
  color: #d4f34a;
  border: none;
  border-radius: 8px;
}
.floor-item.type-table.iso {
  border: none;
  background: transparent;
  padding: 0;
  overflow: visible;
}
.floor-rot {
  width: 100%;
  height: 100%;
  transform-origin: center center;
  pointer-events: none;
}
.floor-label-fixed {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  z-index: 3;
  user-select: none;
}
.floor-item.type-stage {
  border: none;
  background: transparent;
  overflow: visible;
}
.floor-stage-body {
  background: #1c1f26;
  border-radius: 8px;
  border: 1.5px solid #1c1f26;
  display: flex;
  align-items: center;
  justify-content: center;
}
.floor-stage-label {
  color: #d4f34a;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.floor-item.type-table.iso .iso-table-img-wrap {
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  border-radius: 0;
  box-shadow: none !important;
}
.floor-item.type-table.iso.vip .iso-table-img-wrap {
  background: transparent !important;
  box-shadow: none !important;
}
.floor-item.type-table.iso.reserved .iso-table-img-wrap {
  opacity: 0.4;
  filter: grayscale(0.35);
}
.floor-item.type-table.iso.selected {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 8px;
  z-index: 2;
}
.floor-item.type-table.iso.selected .iso-table-img-wrap {
  box-shadow: none !important;
}
.floor-item.type-seat {
  border-radius: 6px;
  background: #fff;
  font-size: 0.55rem;
}
.floor-item.selected {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  z-index: 2;
}

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

@media (max-width: 980px) {
  .charts-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.market-panel {
  margin-bottom: 1rem;
  overflow: hidden;
}
.market-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.35rem;
}
.market-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.toolbar-inline {
  padding: 0.35rem 1rem 0.65rem;
  border: none;
  box-shadow: none;
  background: transparent;
}
.table-wrap-flush {
  border: none;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
}

.lessons-editor {
  margin-top: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--line, #d8e0e4);
  border-radius: 12px;
  background: rgba(15, 40, 50, 0.03);
}
.lessons-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.lesson-row {
  border: 1px solid var(--line, #d8e0e4);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.55rem;
  background: #fff;
}
.lesson-row-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.lesson-row-head strong {
  flex: 1;
}
.lesson-preview-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin: 0;
}
.lesson-row-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.65rem;
}
.lesson-row-fields label.full {
  grid-column: 1 / -1;
}
.lesson-row-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  font-size: 0.8rem;
}
.lesson-row-fields input {
  width: 100%;
  box-sizing: border-box;
}

.market-panel {
  margin-bottom: 1rem;
  overflow: hidden;
}
.market-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.35rem;
}
.market-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.toolbar-inline {
  padding: 0.35rem 1rem 0.65rem;
  border: none;
  box-shadow: none;
  background: transparent;
}
.table-wrap-flush {
  border: none;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
}

@media (max-width: 640px) {
  #stats.stats-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    flex-direction: column;
    align-items: stretch;
  }
  .chart-body {
    grid-template-columns: 1fr;
  }
}

.icon-upload {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.icon-upload > span {
  font-size: 0.85rem;
  color: var(--muted);
}
.icon-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.icon-upload-preview {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line, #d8e0e4);
  background: #fff;
}
.icon-upload-placeholder {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px dashed var(--line, #d8e0e4);
  font-size: 0.7rem;
  color: var(--muted);
  background: #f8fafb;
}
.icon-upload-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  flex: 1;
}
.icon-upload-controls input[type="url"],
.icon-upload-controls input[type="file"] {
  min-width: 140px;
  flex: 1;
}

.attrs-editor {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--line, #d8e0e4);
  border-radius: 12px;
  background: rgba(15, 40, 50, 0.03);
}
.attrs-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.attrs-hint {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.attr-row {
  border: 1px solid var(--line, #d8e0e4);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.55rem;
  background: #fff;
}
.attr-row-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.attr-row-head input {
  flex: 1;
}
.attr-option-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  align-items: center;
}
.attr-option-row input {
  flex: 1;
}
.product-attrs {
  margin-top: 0.35rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.product-attrs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (max-width: 720px) {
  .product-attrs-grid {
    grid-template-columns: 1fr;
  }
}

.form-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  padding: 1rem 1.1rem;
  margin: 0 0 0.85rem;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
}
.form-section h3 {
  grid-column: 1 / -1;
  margin: 0 0 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
}
.form-section > label.full,
.form-section > .full {
  grid-column: 1 / -1;
}

.market-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 980px) {
  .market-layout {
    grid-template-columns: 1fr;
  }
}

.market-panel {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(15, 40, 50, 0.06);
  box-shadow: 0 10px 28px rgba(15, 40, 50, 0.05);
}
.market-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid rgba(15, 40, 50, 0.06);
  background: linear-gradient(180deg, #fbfffe 0%, #ffffff 100%);
}
.market-panel-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.market-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}
.market-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 700;
}

.btn-add-cat,
.btn-add-prod {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.22);
}
.btn-plus {
  display: inline-grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 1rem;
  line-height: 1;
}

.market-cat-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem;
  max-height: min(70vh, 640px);
  overflow: auto;
}
.cat-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.45rem 0.5rem 0.55rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  position: relative;
  transition: background 0.15s ease;
}
.cat-row:hover {
  background: #f3f7f8;
}
.cat-row.is-active {
  background: var(--teal-soft);
}
.cat-row.is-active::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--teal);
}
.cat-row.row-hidden {
  opacity: 0.48;
}
.cat-row-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.1rem 0;
  text-align: start;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.cat-row-main .mchip-icon,
.cat-row-main .mchip-icon-fallback {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: contain;
  flex-shrink: 0;
  background: #f1f5f7;
  border: 1px solid rgba(15, 40, 50, 0.06);
  padding: 7px;
  box-sizing: border-box;
}
.cat-row-main .mchip-icon-fallback {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--cat-tone, #0f766e) 18%, #fff), #f4faf9);
  color: var(--cat-tone, #0f766e);
}
.cat-row-main .mchip-icon-fallback em {
  font-style: normal;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
}
.cat-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  flex: 1;
}
.cat-row-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.cat-row-text strong {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-row.is-active .cat-row-text strong {
  color: var(--teal);
}
.cat-row-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-hidden-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.68rem;
  font-weight: 700;
}
.cat-row-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.cat-row:hover .cat-row-actions,
.cat-row.is-active .cat-row-actions {
  opacity: 1;
}
.cat-ico-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.cat-ico-btn svg {
  width: 16px;
  height: 16px;
}
.cat-ico-btn:hover {
  background: #fff;
  color: var(--teal);
  box-shadow: 0 1px 4px rgba(15, 40, 50, 0.06);
}
.cat-ico-btn.cat-ico-hide:hover {
  color: #b45309;
  background: #fffbeb;
}
.cat-ico-btn.cat-ico-del:hover {
  color: #b91c1c;
  background: #fef2f2;
}
.list-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 600;
}
.list-pill em {
  font-style: normal;
  min-width: 1rem;
  height: 1rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.16);
  font-size: 0.68rem;
}
.list-pill-empty {
  background: #f1f5f9;
  color: var(--muted);
}

.campaign-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}
.campaign-layout-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 180px;
  color: var(--muted);
  font-size: 0.86rem;
}
.campaign-layout-field select {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.market-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid rgba(15, 40, 50, 0.05);
  background: #fbfcfd;
}
.market-filter-wrap,
.market-search-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.market-filter-wrap {
  min-width: 160px;
}
.market-search-wrap {
  flex: 1;
  min-width: 180px;
}
.market-filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.market-filter-select,
.market-search {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(15, 40, 50, 0.1);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  box-shadow: 0 1px 2px rgba(15, 40, 50, 0.03);
}
.market-filter-select:focus,
.market-search:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.market-table-wrap {
  border: 0;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
  position: relative;
  min-height: 180px;
}
.market-table {
  width: 100%;
}
.market-table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f8fafb;
  padding: 0.75rem 1rem;
}
.market-table tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-top: 1px solid rgba(15, 40, 50, 0.05);
}
.market-table tbody tr:hover td {
  background: rgba(15, 118, 110, 0.03);
}

.prod-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.prod-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: #eef2f4;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 40, 50, 0.08);
}

.img-slots {
  display: grid;
  gap: 0.75rem;
}
.img-slot {
  display: grid;
  gap: 0.35rem;
}
.img-slot > span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.img-slot-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.65rem;
  align-items: center;
}
.img-slot-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: #eef2f4;
  border: 1px dashed rgba(15, 40, 50, 0.15);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
}
.img-slot-thumb:hover {
  border-color: rgba(201, 162, 39, 0.55);
  background: #f7f4ea;
}
.img-slot.is-uploading .img-slot-thumb {
  opacity: 0.55;
  pointer-events: none;
}
.img-slot-controls {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.img-slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.img-slot-status {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.img-slot-status.is-error {
  color: #b42318;
}
.img-slot-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-slot-empty {
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 700;
}
.img-slot input[type="url"] {
  width: 100%;
}
.check-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.4rem;
  max-height: 180px;
  overflow: auto;
  padding: 0.5rem;
  border: 1px solid var(--line, #e6e8ec);
  border-radius: 12px;
  background: #f8f9fb;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
}
.prod-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.prod-meta strong {
  font-size: 0.95rem;
  font-weight: 800;
}
.prod-seller {
  font-size: 0.8rem;
  color: var(--muted);
}
.prod-attrs {
  font-size: 0.75rem;
  color: var(--teal);
  font-weight: 600;
}
.prod-price {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.badge-buy {
  background: #ecfdf5;
  color: #047857;
}
.badge-rent {
  background: #fff7ed;
  color: #c2410c;
}
.badge-cat {
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal);
}

.market-empty {
  display: grid;
  place-items: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  text-align: center;
}
.market-empty.hidden {
  display: none;
}
.market-empty-inline {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- Auctions ---- */
.nav-item { position: relative; }
.nav-badge {
  margin-inline-start: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}
.nav-badge.hidden { display: none; }
.auction-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.auction-toolbar .search { flex: 1 1 220px; }
.auction-title-cell { display: flex; gap: 10px; align-items: center; min-width: 200px; }
.auction-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  flex: none;
  background: #e6efed;
  display: inline-block;
}
.badge-warn { background: #fff4e0; color: #8a5a00; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-approve { background: #4f7e78 !important; color: #fff !important; }
.auction-bids-row td { background: #f6f8f8; }
.auction-bids { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.auction-bids li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff;
}
.auction-bids li:first-child { outline: 1.5px solid #4f7e78; }
.brand-logo { border-radius: 50% !important; border: 1px solid #e4e7e6; }
.auction-toolbar { flex-wrap: nowrap; }
.auction-toolbar .market-filter-select { width: auto; min-width: 150px; flex: 0 0 auto; }
.auction-toolbar .btn { flex: 0 0 auto; }
@media (max-width: 700px) { .auction-toolbar { flex-wrap: wrap; } }
