@import url("https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap");

:root {
  --bg: #eef4ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --border: rgba(21, 76, 196, 0.14);
  --text: #11203d;
  --muted: #5d6b8a;
  --primary: #1f6fff;
  --primary-dark: #1547b3;
  --accent: #04b8a5;
  --warning: #f4a524;
  --danger: #d44f5a;
  --success: #0c9a6a;
  --shadow: 0 18px 40px rgba(17, 32, 61, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Kanit", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      circle at top left,
      rgba(31, 111, 255, 0.18),
      transparent 28%
    ),
    radial-gradient(
      circle at top right,
      rgba(4, 184, 165, 0.15),
      transparent 26%
    ),
    linear-gradient(180deg, #f7fbff 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 28px;
  background: linear-gradient(
    120deg,
    rgba(12, 39, 104, 0.92),
    rgba(31, 111, 255, 0.92)
  );
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(16, 45, 117, 0.22);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.25),
    rgba(255, 255, 255, 0.08)
  );
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-name {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.brand-sub {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.78);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.95rem;
}

.ghost-link {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

.page-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 120px;
}

.page-head {
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.page-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero {
  display: grid;
  gap: 22px;
  margin-bottom: 22px;
}

.hero-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
}

.hero-panel,
.card,
.auth-card,
.stat-card,
.product-card,
.list-item,
.store-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 34px;
  background:
    linear-gradient(140deg, rgba(12, 39, 104, 0.96), rgba(31, 111, 255, 0.84)),
    radial-gradient(
      circle at top right,
      rgba(255, 255, 255, 0.24),
      transparent 28%
    );
  color: #fff;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.hero-panel h2 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.08;
}

.hero-panel p {
  max-width: 640px;
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
}

.hero-card {
  padding: 26px;
}

.cta-row,
.actions-row,
.inline-form,
.card-header,
.split {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
  box-shadow: 0 12px 26px rgba(31, 111, 255, 0.2);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-outline {
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.btn-secondary {
  color: var(--primary-dark);
  background: rgba(31, 111, 255, 0.08);
  box-shadow: none;
}

.btn-light {
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 12px 26px rgba(12, 39, 104, 0.16);
}

.btn-light-outline {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.btn-danger {
  background: linear-gradient(135deg, #f16d7a, var(--danger));
  box-shadow: 0 12px 26px rgba(212, 79, 90, 0.2);
}

.btn-small {
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.alert {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.96rem;
}

.alert-success {
  color: #0f6847;
  background: rgba(12, 154, 106, 0.12);
  border: 1px solid rgba(12, 154, 106, 0.18);
}

.alert-error {
  color: #8f2730;
  background: rgba(212, 79, 90, 0.1);
  border: 1px solid rgba(212, 79, 90, 0.18);
}

.stats-grid,
.grid,
.form-grid,
.product-grid,
.store-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 18px;
}

.stat-card {
  padding: 22px;
}

.stat-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.stat-value {
  font-size: clamp(1.5rem, 2vw, 2.15rem);
  font-weight: 700;
  line-height: 1.1;
}

.stat-foot {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid.three,
.product-grid,
.store-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card,
.auth-card {
  padding: 24px;
}

.card-title {
  margin: 0;
  font-size: 1.16rem;
}

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

.small {
  font-size: 0.9rem;
}

.form-grid {
  grid-template-columns: repeat(12, 1fr);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-column: span 12;
}

.field.half {
  grid-column: span 6;
}

.field.third {
  grid-column: span 4;
}

.field label {
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(21, 76, 196, 0.14);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(31, 111, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(31, 111, 255, 0.08);
}

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

.checkbox-grid {
  display: grid;
  gap: 16px;
}

.checkbox-card {
  padding: 18px;
  border: 1px solid rgba(21, 76, 196, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.checkbox-card input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(21, 76, 196, 0.08);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

tbody tr:hover {
  background: rgba(31, 111, 255, 0.03);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-success {
  color: #0f6847;
  background: rgba(12, 154, 106, 0.12);
}

.badge-warning {
  color: #9a6509;
  background: rgba(244, 165, 36, 0.18);
}

.badge-danger {
  color: #8f2730;
  background: rgba(212, 79, 90, 0.12);
}

.badge-info {
  color: #0d5d9f;
  background: rgba(31, 111, 255, 0.14);
}

.badge-default {
  color: var(--muted);
  background: rgba(93, 107, 138, 0.12);
}

.product-card {
  overflow: hidden;
}

.product-media {
  aspect-ratio: 4 / 3;
  background: linear-gradient(
    160deg,
    rgba(31, 111, 255, 0.1),
    rgba(4, 184, 165, 0.12)
  );
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  padding: 18px;
}

.product-body h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.price {
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.price-note {
  font-size: 0.88rem;
  color: var(--muted);
}

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

.list-item {
  padding: 18px;
}

.list-item h3,
.list-item h4 {
  margin: 0 0 6px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  padding: 28px;
  text-align: center;
  border: 1px dashed rgba(21, 76, 196, 0.2);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

.auth-layout {
  display: grid;
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.auth-side {
  padding: 30px;
  border-radius: 28px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(12, 39, 104, 0.97), rgba(31, 111, 255, 0.88)),
    radial-gradient(
      circle at bottom left,
      rgba(255, 255, 255, 0.16),
      transparent 35%
    );
  box-shadow: 0 18px 42px rgba(17, 32, 61, 0.18);
}

.auth-side h2 {
  margin-top: 0;
  font-size: 2rem;
}

.auth-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.9);
}

.store-banner {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 24px;
  margin-bottom: 18px;
}

.store-logo,
.logo-preview {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    rgba(31, 111, 255, 0.14),
    rgba(4, 184, 165, 0.2)
  );
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.logo-preview img,
.store-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-banner h2 {
  margin: 0 0 6px;
}

.store-banner p {
  margin: 0;
  color: var(--muted);
}

.chat-dashboard {
  align-items: start;
}

.chat-card,
.chat-panel,
.chat-thread-list {
  display: grid;
  gap: 16px;
}

.chat-messages {
  display: grid;
  gap: 12px;
  max-height: 540px;
  overflow: auto;
  padding: 4px 2px;
}

.chat-message {
  display: flex;
}

.chat-message.is-user {
  justify-content: flex-start;
}

.chat-message.is-admin {
  justify-content: flex-end;
}

.chat-message-bubble {
  max-width: min(680px, 92%);
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(31, 111, 255, 0.08);
  border: 1px solid rgba(31, 111, 255, 0.12);
}

.chat-message.is-admin .chat-message-bubble {
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(31, 111, 255, 0.96),
    rgba(21, 71, 179, 0.96)
  );
  border-color: transparent;
}

.chat-message-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.chat-message.is-admin .chat-message-meta {
  color: rgba(255, 255, 255, 0.82);
}

.chat-message-text {
  line-height: 1.55;
  white-space: normal;
}

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

.chat-thread-stack {
  display: grid;
  gap: 12px;
}

.chat-thread-item {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(21, 76, 196, 0.1);
  background: rgba(255, 255, 255, 0.88);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.chat-thread-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(17, 32, 61, 0.08);
}

.chat-thread-item.is-active {
  border-color: rgba(31, 111, 255, 0.35);
  box-shadow: 0 0 0 4px rgba(31, 111, 255, 0.08);
}

.chat-thread-title {
  font-weight: 600;
}

.chat-thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.chat-thread-preview {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
}

.chat-ticket-form {
  display: grid;
  gap: 14px;
}

.chat-ticket-divider {
  height: 1px;
  background: rgba(21, 76, 196, 0.1);
}

.chat-thread-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.chat-empty {
  margin: 0;
}

.summary-panel {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(
    160deg,
    rgba(31, 111, 255, 0.08),
    rgba(4, 184, 165, 0.08)
  );
}

.dashboard-hero-card,
.dashboard-overview-card {
  border-radius: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.dashboard-hero-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  color: #fff;
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 255, 255, 0.18),
      transparent 25%
    ),
    linear-gradient(135deg, #0c3ea6 0%, #1f6fff 52%, #58a3ff 100%);
}

.dashboard-hero-card::after {
  content: "";
  position: absolute;
  right: -56px;
  bottom: -56px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-hero-top,
.dashboard-overview-head,
.dashboard-hero-actions {
  position: relative;
  z-index: 1;
}

.dashboard-hero-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.dashboard-store-logo {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0.08)
  );
}

.dashboard-hero-copy h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.dashboard-hero-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}

.dashboard-hero-meta {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.84);
}

.dashboard-eyebrow {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
}

.dashboard-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.92rem;
  font-weight: 600;
}

.dashboard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.dashboard-overview-card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(21, 76, 196, 0.12);
}

.dashboard-overview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-link {
  color: var(--primary-dark);
  font-weight: 600;
}

.dashboard-highlight-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 16px;
}

.dashboard-highlight-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(
    160deg,
    rgba(31, 111, 255, 0.08),
    rgba(4, 184, 165, 0.08)
  );
  border: 1px solid rgba(21, 76, 196, 0.1);
}

.dashboard-highlight-label,
.dashboard-highlight-foot {
  color: var(--muted);
}

.dashboard-highlight-value {
  font-size: clamp(1.4rem, 2vw, 2rem);
  color: var(--text);
}

.dashboard-highlight-foot {
  font-size: 0.9rem;
}

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

.dashboard-metric-card {
  display: grid;
  gap: 10px;
  min-height: 170px;
  padding: 16px 14px;
  border-radius: 18px;
  text-align: center;
  color: #fff;
  box-shadow: 0 16px 32px rgba(17, 32, 61, 0.14);
}

.dashboard-metric-card.is-primary {
  background: linear-gradient(180deg, #1f6fff 0%, #2167df 100%);
}

.dashboard-metric-card.is-secondary {
  background: linear-gradient(180deg, #64a9ff 0%, #5b9cf6 100%);
}

.dashboard-metric-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
}

.dashboard-metric-value {
  align-self: center;
  font-size: clamp(1.4rem, 2vw, 2.3rem);
  font-weight: 700;
  line-height: 1.1;
}

.dashboard-metric-foot {
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.dashboard-secondary-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-bottom: 18px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  width: min(94vw, 860px);
  padding: 12px;
  border: 1px solid rgba(21, 76, 196, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 35px rgba(17, 32, 61, 0.14);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 500;
}

.bottom-nav-item.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.info-note {
  padding: 14px 16px;
  border-radius: 16px;
  color: #11305a;
  background: rgba(31, 111, 255, 0.08);
  border: 1px solid rgba(31, 111, 255, 0.14);
}

.cover-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.status-navbar,
.category-navbar {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.status-tab,
.category-tab {
  flex: 0 0 auto;
  padding: 10px 8px 14px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 500;
  cursor: pointer;
}

.status-tab.is-active,
.category-tab.is-active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}

.search-bar {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  align-items: center;
}

.search-bar input {
  flex: 1;
}

.product-select-card {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.product-select-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(17, 32, 61, 0.08);
}

.product-select-focus {
  border-color: rgba(31, 111, 255, 0.38);
  box-shadow:
    0 0 0 4px rgba(31, 111, 255, 0.08),
    0 16px 32px rgba(17, 32, 61, 0.08);
}

.product-select-card.is-selected {
  border-color: rgba(12, 154, 106, 0.36);
  box-shadow:
    0 0 0 4px rgba(12, 154, 106, 0.08),
    0 16px 32px rgba(17, 32, 61, 0.08);
}

.distribution-select-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(31, 111, 255, 0.06);
  cursor: pointer;
}

.distribution-select-toggle input[type="checkbox"] {
  width: 24px;
  min-width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.distribution-select-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.distribution-select-copy strong {
  font-size: 1rem;
}

.distribution-select-copy span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.distribution-picker-media {
  width: 100%;
  height: 220px;
  overflow: hidden;
  margin-bottom: 14px;
  border-radius: 18px;
  background: linear-gradient(
    160deg,
    rgba(31, 111, 255, 0.1),
    rgba(4, 184, 165, 0.12)
  );
}

.distribution-picker-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.distribution-picker-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.distribution-price-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.distribution-price-box {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(
    160deg,
    rgba(31, 111, 255, 0.08),
    rgba(31, 111, 255, 0.14)
  );
}

.distribution-price-box.is-profit {
  background: linear-gradient(
    160deg,
    rgba(12, 154, 106, 0.08),
    rgba(12, 154, 106, 0.14)
  );
}

.distribution-price-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.distribution-price-value {
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  line-height: 1.1;
  color: var(--text);
}

.distribution-mobile-hero {
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(21, 76, 196, 0.14);
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, #1062ea 0%, #2f86ff 100%);
  box-shadow: var(--shadow);
}

.distribution-mobile-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.distribution-mobile-logo {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
}

.distribution-mobile-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.distribution-mobile-copy h2 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.distribution-mobile-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

.distribution-mobile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 164, 28, 0.95);
}

.distribution-menu-card {
  margin-bottom: 18px;
}

.distribution-menu-list,
.distribution-top-list,
.distribution-manage-list {
  display: grid;
  gap: 14px;
}

.distribution-menu-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 8px;
  border-bottom: 1px solid rgba(21, 76, 196, 0.08);
}

.distribution-menu-item:last-child {
  border-bottom: none;
}

.distribution-menu-icon,
.distribution-menu-arrow {
  display: grid;
  place-items: center;
}

.distribution-menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 1.1rem;
  color: var(--primary-dark);
  background: rgba(31, 111, 255, 0.08);
}

.distribution-menu-copy {
  display: grid;
  gap: 4px;
}

.distribution-menu-copy strong {
  font-size: 1rem;
}

.distribution-menu-copy span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.distribution-menu-arrow {
  color: var(--muted);
  font-size: 1.5rem;
}

.distribution-top-item,
.distribution-manage-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(21, 76, 196, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
}

.distribution-top-media,
.distribution-manage-media {
  width: 120px;
  height: 120px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(
    160deg,
    rgba(31, 111, 255, 0.1),
    rgba(4, 184, 165, 0.12)
  );
}

.distribution-top-media img,
.distribution-manage-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.distribution-top-content,
.distribution-manage-content {
  min-width: 0;
}

.distribution-top-content h4,
.distribution-manage-content h4 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.distribution-top-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.distribution-manage-form {
  margin-top: 12px;
}

.distribution-hide-form {
  margin-top: 12px;
  justify-content: flex-end;
}

.order-list {
  display: grid;
  gap: 16px;
}

.order-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 180px;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(21, 76, 196, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
}

.order-media {
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(
    160deg,
    rgba(31, 111, 255, 0.1),
    rgba(4, 184, 165, 0.12)
  );
}

.order-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-media-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--primary-dark);
}

.order-main h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

.order-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.order-side-label,
.order-side-profit-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.order-side-total {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.order-side-profit {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--danger);
}

@media (max-width: 960px) {
  .hero-grid,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .field.half,
  .field.third {
    grid-column: span 12;
  }

  .topbar {
    align-items: flex-start;
    /* flex-direction: column; */
  }

  .order-card {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .order-side {
    grid-column: 1 / -1;
    text-align: left;
  }

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

  .distribution-mobile-top {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .distribution-mobile-action {
    grid-column: 1 / -1;
    justify-self: flex-start;
  }
}

@media (max-width: 720px) {
  .page-content {
    padding: 18px 16px 118px;
  }

  .hero-panel,
  .card,
  .auth-card,
  .stat-card,
  .store-banner {
    padding: 20px;
  }

  .topbar {
    padding: 16px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .store-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-hero-card,
  .dashboard-overview-card {
    padding: 20px;
    border-radius: 24px;
  }

  .dashboard-hero-top {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .dashboard-badge {
    justify-self: flex-start;
  }

  .dashboard-highlight-grid,
  .dashboard-metric-grid {
    grid-template-columns: 1fr;
  }

  .distribution-top-item,
  .distribution-manage-item {
    grid-template-columns: 1fr;
  }

  .distribution-picker-media,
  .distribution-top-media,
  .distribution-manage-media {
    width: 100%;
    height: 180px;
  }

  .distribution-price-band {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    gap: 8px;
    padding: 10px;
  }

  .bottom-nav-item {
    font-size: 0.86rem;
    min-height: 42px;
    padding: 8px 10px;
  }

  .search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .order-card {
    grid-template-columns: 1fr;
  }

  .order-media {
    width: 100%;
    height: 180px;
  }
}

/* ===== FB Dashboard Styles ===== */
.page-shell:has(.fb-dashboard) .topbar {
  display: none;
}
.page-shell:has(.fb-dashboard) .page-head {
  display: none;
}
.page-shell:has(.fb-dashboard) .page-content {
  padding-top: 0;
  max-width: 600px;
}

.fb-header {
  margin: -24px -24px 0;
  padding: 22px 20px 20px;
  background: linear-gradient(135deg, #4267b2 0%, #3b5da7 50%, #5b7bd5 100%);
  color: #fff;
}
.fb-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fb-header-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: #3b5998;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.fb-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fb-header-logo span {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}
.fb-header-info {
  flex: 1;
  min-width: 0;
}
.fb-header-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fb-header-name {
  font-size: 1.2rem;
  font-weight: 600;
}
.fb-header-domain {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.75rem;
  font-weight: 500;
}
.fb-header-vip {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.85rem;
}
.fb-vip-icon {
  font-size: 1rem;
}
.fb-header-chat {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.fb-header-chat-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #ff3b30;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0 4px;
}

/* Store Data */
.fb-store-data {
  padding: 16px 18px;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.fb-store-data-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.fb-store-data-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.fb-expand-link {
  color: #666;
  font-size: 0.85rem;
}
.fb-totals-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.fb-total-block {
}
.fb-total-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
}
.fb-total-label {
  font-size: 0.8rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 4px;
}
.fb-eye {
  font-size: 0.75rem;
}

/* 3x3 Stats */
.fb-stats-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.fb-stat {
  text-align: center;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: #fff;
}
.fb-stat.blue {
  border-color: #4a90d9;
  background: rgba(74, 144, 217, 0.04);
}
.fb-stat.green {
  border-color: #34c759;
  background: rgba(52, 199, 89, 0.04);
}
.fb-stat.orange {
  border-color: #ff9500;
  background: rgba(255, 149, 0, 0.04);
}
.fb-stat-title {
  font-size: 0.72rem;
  color: #666;
  line-height: 1.3;
}
.fb-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
}
.fb-stat.blue .fb-stat-val {
  color: #4a90d9;
}
.fb-stat.green .fb-stat-val {
  color: #34c759;
}
.fb-stat.orange .fb-stat-val {
  color: #ff9500;
}

/* Quick Actions */
.fb-actions-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 20px 14px;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.fb-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 4px;
  text-decoration: none;
  color: #333;
}
.fb-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f0f0f0;
}
.fb-action-item span {
  font-size: 0.78rem;
  text-align: center;
  color: #444;
  line-height: 1.3;
}

/* Payment */
.fb-payment-section {
  padding: 0 14px 20px;
  background: #fff;
}
.fb-payment-divider {
  height: 1px;
  background: #e5e5e5;
  margin-bottom: 16px;
}
.fb-payment-title {
  margin: 0 0 14px 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}
.fb-payment-card {
  padding: 20px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #e8f0fe, #d4e4f7);
}
.fb-payment-grid {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.fb-payment-grid-center {
  margin-top: 12px;
}
.fb-payment-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.fb-payment-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.fb-payment-item span {
  font-size: 0.7rem;
  color: #333;
  font-weight: 500;
}

/* Updated Bottom Nav */
.bottom-nav {
  position: fixed;
  left: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  border-radius: 0;
  gap: 0;
  padding: 6px 0 env(safe-area-inset-bottom, 8px);
  background: #fff;
  border: none;
  border-top: 1px solid #e5e5e5;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  backdrop-filter: none;
  z-index: 100;
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: auto;
  padding: 6px 4px;
  border-radius: 0;
  color: #999;
  font-size: 0.75rem;
  font-weight: 400;
  text-decoration: none;
  position: relative;
}
.bottom-nav-item.is-active {
  color: #4a90d9;
  background: none;
}
.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
}
.bottom-nav-label {
  font-size: 0.7rem;
  line-height: 1;
}

.bottom-nav-icon {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #f16d7a, #d44f5a);
  box-shadow: 0 2px 8px rgba(212, 79, 90, 0.4);
  animation: badge-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes badge-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (min-width: 721px) {
  .page-shell:has(.fb-dashboard) .page-content {
    padding: 0 24px 100px;
  }
  .fb-header {
    margin: 0 -24px;
  }
}
@media (max-width: 720px) {
  .page-shell:has(.fb-dashboard) .page-content {
    padding: 0 0 80px;
  }
  .fb-header {
    margin: 0;
  }
}

/* ===== Store Products Page ===== */
.fb-header-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
}
.fb-header-settings {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
}

.fb-section-title {
  margin: 0;
  padding: 14px 18px 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  background: #fff;
}

.fb-menu-section {
  background: #fff;
  border-bottom: 8px solid #f2f2f2;
}
.fb-menu-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #333;
}
.fb-menu-row:last-child {
  border-bottom: none;
}
.fb-menu-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.fb-menu-label {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}
.fb-menu-arrow {
  color: #ccc;
  font-size: 1.4rem;
  font-weight: 300;
}

.fb-top10-section {
  background: #fff;
  padding-bottom: 12px;
}
.fb-top10-list {
  display: flex;
  flex-direction: column;
}
.fb-top10-item {
  display: flex;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #333;
}
.fb-top10-item:last-child {
  border-bottom: none;
}
.fb-top10-img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f0;
}
.fb-top10-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fb-top10-img-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #999;
}
.fb-top10-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.fb-top10-name {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fb-top10-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: #888;
}
.fb-empty {
  padding: 28px;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
}

/* ===== Distribute Page ===== */
.fb-topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #4267b2, #5b7bd5);
  color: #fff;
}
.fb-topnav-back {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.fb-topnav-title {
  flex: 1;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
}
.fb-topnav-spacer {
  width: 70px;
}

.fb-cat-tabs {
  background: #fff;
  border-bottom: 1px solid #eee;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.fb-cat-scroll {
  display: flex;
  gap: 0;
  white-space: nowrap;
  padding: 0 4px;
}
.fb-cat-tab {
  flex-shrink: 0;
  padding: 12px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: #666;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}
.fb-cat-tab.is-active {
  color: #333;
  border-bottom-color: #333;
  font-weight: 600;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #d44f5a;
  vertical-align: middle;
}

.fb-cat-tab.is-active .tab-badge {
  color: #d44f5a;
  background: rgba(212, 79, 90, 0.12);
}

.fb-search-section {
  padding: 10px 14px;
  background: #fff;
}
.fb-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  background: #fff;
}
.fb-search-box input {
  flex: 1;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  background: none;
  outline: none;
  box-shadow: none;
}
.fb-search-box input:focus {
  box-shadow: none;
  border: none;
}

.fb-product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 14px;
  background: #f5f5f5;
}
.fb-pcard {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.fb-pcard.is-selected {
  border-color: #4a90d9;
}
.fb-pcard-img {
  position: relative;
  aspect-ratio: 3/4;
  background: #f0f0f0;
  overflow: hidden;
}
.fb-pcard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fb-pcard-img-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: #ccc;
}
.fb-pcard-check {
  position: absolute;
  top: 8px;
  right: 8px;
  cursor: pointer;
}
.fb-pcard-check input {
  display: none;
}
.fb-pcard-checkmark {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.15s;
}
.fb-pcard-check input:checked + .fb-pcard-checkmark {
  background: #4a90d9;
  border-color: #4a90d9;
  box-shadow: inset 0 0 0 3px #fff;
}
.fb-pcard-body {
  padding: 10px 10px 12px;
}
.fb-pcard-name {
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  height: 2.2em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.fb-pcard-price {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #888;
}
.fb-pcard-price span {
  color: #e74c3c;
  font-weight: 600;
}
.fb-pcard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 6px;
}
.fb-pcard-cat {
  flex: 1;
  min-width: 0;
  font-size: 0.7rem;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-pcard-btn {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 6px;
  background: #4a90d9;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}

.fb-dist-bottom {
  position: sticky;
  bottom: 60px;
  z-index: 50;
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #eee;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}
.fb-dist-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.fb-dist-btn.primary {
  background: linear-gradient(135deg, #4a90d9, #3b7bc8);
  color: #fff;
  position: relative;
}
.fb-dist-btn.secondary {
  background: linear-gradient(135deg, #5b9cf6, #4a90d9);
  color: #fff;
}
.fb-dist-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #ff3b30;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ===== Manage Page ===== */
.fb-cat-equal {
  justify-content: center;
}
.fb-cat-equal .fb-cat-tab {
  flex: 1;
  text-align: center;
}

.fb-manage-list {
  background: #f5f5f5;
  padding: 10px 0;
}
.fb-manage-card {
  background: #fff;
  margin: 0 0 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
}
.fb-manage-card:last-child {
  margin-bottom: 0;
}
.fb-manage-card > div:first-child,
.fb-manage-card > .fb-manage-img {
  display: inline;
}
.fb-manage-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  grid-template-rows: auto auto;
  gap: 0 14px;
}
.fb-manage-img {
  grid-row: 1 / 3;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
}
.fb-manage-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fb-manage-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.fb-manage-name {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.fb-manage-prices {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: #666;
}
.fb-manage-prices strong {
  color: #111;
  font-weight: 700;
}
.fb-manage-bottom {
  grid-column: 1 / -1;
  padding-top: 8px;
}
.fb-manage-edit-link {
  color: #4a90d9;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.fb-manage-form {
  grid-column: 1 / -1;
  display: none;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  margin-top: 8px;
}
.fb-manage-form.is-open {
  display: block;
}
.fb-manage-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.fb-manage-field label {
  display: block;
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 4px;
}
.fb-manage-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.88rem;
}
.fb-manage-form-actions {
  margin-bottom: 8px;
}
.fb-manage-form-actions .fb-dist-btn {
  width: 100%;
  padding: 10px;
}
.fb-manage-hide-form {
  margin-top: 6px;
}
.fb-manage-hide-btn {
  width: 100%;
  padding: 10px;
  border: 1px solid #e74c3c;
  border-radius: 10px;
  background: none;
  color: #e74c3c;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

/* ===== Profile Page ===== */
.fb-profile-header {
  padding: 28px 20px 50px;
  background: linear-gradient(135deg, #4267b2 0%, #3b5da7 50%, #5b7bd5 100%);
  color: #fff;
}
.fb-profile-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fb-profile-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  background: #3b5998;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.fb-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fb-profile-avatar span {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}
.fb-profile-id {
  font-size: 0.9rem;
  font-weight: 500;
}

.fb-profile-balance {
  padding: 0 16px;
  margin-top: -36px;
  position: relative;
  z-index: 2;
}
.fb-profile-balance-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.fb-profile-pending {
  font-size: 0.88rem;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}
.fb-profile-pending-val {
  color: #4a90d9;
  font-weight: 600;
}
.fb-profile-wallet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.9rem;
}
.fb-profile-wallet-row span {
  color: #666;
}
.fb-profile-wallet-row strong {
  color: #111;
  font-size: 1rem;
}

.fb-profile-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.fb-profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}
.fb-profile-btn.outline {
  border: 1.5px solid #333;
  color: #333;
  background: #fff;
}
.fb-profile-btn.filled {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #4a90d9, #3b7bc8);
}

.fb-profile-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  margin: 12px 0 0;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.82rem;
  color: #555;
  line-height: 1.4;
  overflow: hidden;
}
.fb-profile-notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.marquee-wrapper {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-text {
  display: inline-block;
  animation: marquee-scroll 18s linear infinite;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.fb-profile-menu {
  background: #fff;
  margin-top: 10px;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}
.fb-profile-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid #f5f5f5;
  text-decoration: none;
  color: #333;
}
.fb-profile-menu-item:last-child {
  border-bottom: none;
}
.fb-profile-menu-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.fb-profile-menu-label {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 500;
}
.fb-profile-menu-arrow {
  color: #ccc;
  font-size: 1.3rem;
  font-weight: 300;
}

.fb-profile-logout {
  padding: 20px 18px 30px;
}
.fb-profile-logout-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #4a90d9, #3b7bc8);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Language Switch ===== */
.fb-lang-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-bottom: 1px solid #f5f5f5;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.fb-lang-item:last-child {
  border-bottom: none;
}
.fb-lang-flag {
  font-size: 1.5rem;
}
.fb-lang-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
}
.fb-lang-sub {
  color: #999;
  font-weight: 400;
}
.fb-lang-active {
  padding: 3px 10px;
  border-radius: 6px;
  background: #4a90d9;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}
.fb-lang-arrow {
  color: #ccc;
  font-size: 1.3rem;
  font-weight: 300;
}

/* ===== Orders Page ===== */
.fb-order-list {
  background: #f5f5f5;
  padding: 6px 0;
}
.fb-order-card {
  background: #fff;
  margin: 0 0 8px;
  padding: 0;
  border-bottom: 1px solid #f0f0f0;
}
.fb-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 0;
}
.fb-order-dots {
  color: #999;
  font-size: 1.2rem;
  letter-spacing: 2px;
}
.fb-order-status {
  font-size: 0.82rem;
  color: #888;
  font-weight: 500;
}
.fb-order-body {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
}
.fb-order-img {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f0;
}
.fb-order-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fb-order-info {
  flex: 1;
  min-width: 0;
}
.fb-order-name {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.fb-order-meta {
  font-size: 0.75rem;
  color: #999;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-order-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.82rem;
  color: #555;
}
.fb-order-income {
  color: #34c759;
  font-weight: 600;
}
.fb-order-footer {
  padding: 8px 16px 12px;
  border-top: 1px solid #f8f8f8;
}
.fb-order-detail-link {
  color: #4a90d9;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

/* ===== Category Manager ===== */

.cat-form {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(
    160deg,
    rgba(31, 111, 255, 0.05),
    rgba(4, 184, 165, 0.05)
  );
  border: 1px dashed rgba(31, 111, 255, 0.18);
}

.cat-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 80px auto;
  gap: 12px;
  align-items: end;
}

.cat-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--muted);
}

.cat-field input {
  padding: 10px 12px;
  font-size: 0.94rem;
}

.cat-field-btn {
  display: flex;
  flex-direction: column;
}

.cat-field-btn .btn {
  white-space: nowrap;
}

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

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(21, 76, 196, 0.08);
  background: rgba(255, 255, 255, 0.85);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.cat-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(17, 32, 61, 0.06);
  border-color: rgba(31, 111, 255, 0.18);
}

.cat-item-editing {
  border-color: rgba(31, 111, 255, 0.4);
  background: rgba(31, 111, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(31, 111, 255, 0.08);
}

.cat-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cat-item-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.3rem;
  background: linear-gradient(
    135deg,
    rgba(31, 111, 255, 0.1),
    rgba(4, 184, 165, 0.1)
  );
  flex-shrink: 0;
}

.cat-item-label {
  font-size: 0.98rem;
  font-weight: 600;
}

.cat-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.cat-item-meta .badge {
  font-size: 0.76rem;
  padding: 4px 8px;
}

.cat-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .cat-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cat-field-name {
    grid-column: 1 / -1;
  }

  .cat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .cat-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .cat-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Wallet Transaction History ========== */
.wallet-balance-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 20px;
  background: linear-gradient(135deg, #1f6fff 0%, #4a90d9 100%);
  color: #fff;
  text-align: center;
}

.wallet-balance-label {
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 500;
}

.wallet-balance-amount {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.wallet-tx-list {
  background: #f7f8fc;
  padding: 8px 0;
}

.wallet-tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.wallet-tx-item:last-child {
  border-bottom: none;
}

.wallet-tx-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.wallet-tx-info {
  flex: 1;
  min-width: 0;
}

.wallet-tx-desc {
  font-size: 0.88rem;
  font-weight: 500;
  color: #333;
  line-height: 1.4;
  word-break: break-word;
}

.wallet-tx-date {
  font-size: 0.75rem;
  color: #999;
  margin-top: 2px;
}

.wallet-tx-right {
  text-align: right;
  flex-shrink: 0;
}

.wallet-tx-amount {
  font-size: 0.95rem;
  font-weight: 700;
}

.wallet-tx-amount.is-positive {
  color: #27ae60;
}

.wallet-tx-amount.is-negative {
  color: #e74c3c;
}

.wallet-tx-balance {
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 2px;
}
