:root {
  --vm-blue: #2563eb;
  --vm-blue-dark: #1d4ed8;
  --vm-blue-soft: #eff6ff;
  --vm-orange: #f59e0b;
  --vm-green: #16a34a;
  --vm-red: #dc2626;
  --vm-slate-950: #0f172a;
  --vm-slate-900: #111827;
  --vm-slate-800: #1f2937;
  --vm-slate-700: #334155;
  --vm-slate-600: #475569;
  --vm-slate-500: #64748b;
  --vm-slate-400: #94a3b8;
  --vm-slate-300: #cbd5e1;
  --vm-slate-200: #e2e8f0;
  --vm-slate-100: #f1f5f9;
  --vm-slate-50: #f8fafc;
  --vm-surface: #ffffff;
  --vm-page: #f6f7fb;
  --vm-radius-sm: 10px;
  --vm-radius: 14px;
  --vm-radius-lg: 20px;
  --vm-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --vm-shadow: 0 10px 30px rgba(15, 23, 42, .07);
  --vm-touch: 44px;
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: hidden; }
body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--vm-slate-900);
  background: var(--vm-page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Noto Sans JP", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--vm-blue); }
a:hover { color: var(--vm-blue-dark); }
img { max-width: 100%; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button, .btn { font-weight: 600; }

.btn {
  --bs-btn-border-radius: 10px;
  transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, border-color .14s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  --bs-btn-bg: var(--vm-blue);
  --bs-btn-border-color: var(--vm-blue);
  --bs-btn-hover-bg: var(--vm-blue-dark);
  --bs-btn-hover-border-color: var(--vm-blue-dark);
  --bs-btn-active-bg: var(--vm-blue-dark);
  --bs-btn-active-border-color: var(--vm-blue-dark);
}
.btn-outline-primary {
  --bs-btn-color: var(--vm-blue);
  --bs-btn-border-color: #93b4f9;
  --bs-btn-hover-bg: var(--vm-blue);
  --bs-btn-hover-border-color: var(--vm-blue);
}
.btn-success { --bs-btn-bg: var(--vm-green); --bs-btn-border-color: var(--vm-green); }
.btn-danger { --bs-btn-bg: var(--vm-red); --bs-btn-border-color: var(--vm-red); }

.card, .vm-panel {
  background: var(--vm-surface);
  border: 1px solid var(--vm-slate-200);
  border-radius: var(--vm-radius);
  box-shadow: var(--vm-shadow-sm);
}
.card { overflow: hidden; }
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--vm-slate-200);
  font-weight: 700;
  padding: 14px 18px;
}
.card-body { padding: 18px; }

.form-control, .form-select {
  border: 1px solid var(--vm-slate-300);
  border-radius: 10px;
  min-height: 44px;
  max-width: 100%;
  background-color: #fff;
  box-shadow: none;
}
.form-control:focus, .form-select:focus {
  border-color: #7aa2f7;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
textarea.form-control, textarea { min-height: 120px; }
form p { margin-bottom: 16px; }
form p label, .form-label { display: block; font-weight: 700; color: var(--vm-slate-700); margin-bottom: 6px; }
form p input:not([type="checkbox"]):not([type="radio"]),
form p select,
form p textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--vm-slate-300);
  border-radius: 10px;
  background: #fff;
  outline: none;
}
form p input:focus, form p select:focus, form p textarea:focus {
  border-color: #7aa2f7;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.helptext, .form-text { display: block; color: var(--vm-slate-500); font-size: .84rem; margin-top: 5px; }
.errorlist { color: #b91c1c; padding-left: 18px; margin-top: 6px; font-size: .9rem; }

.alert {
  border: 0;
  border-radius: 12px;
  border-left: 4px solid currentColor;
  box-shadow: var(--vm-shadow-sm);
}
.alert-info { color: #075985; background: #f0f9ff; }
.alert-success { color: #166534; background: #f0fdf4; }
.alert-danger { color: #991b1b; background: #fef2f2; }
.alert-warning { color: #92400e; background: #fffbeb; }

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--vm-slate-200);
  border-radius: var(--vm-radius);
  background: #fff;
  box-shadow: var(--vm-shadow-sm);
}
.table-responsive > .table { margin-bottom: 0; }
.table { --bs-table-bg: transparent; --bs-table-striped-bg: #fafbfc; color: var(--vm-slate-800); }
.table thead th {
  background: #f8fafc;
  color: var(--vm-slate-600);
  font-size: .78rem;
  font-weight: 800;
  text-transform: none;
  white-space: nowrap;
  letter-spacing: .01em;
  border-bottom: 1px solid var(--vm-slate-200);
  padding: 13px 14px;
}
.table tbody td {
  vertical-align: middle;
  padding: 13px 14px;
  border-color: #eef2f6;
}
.table tbody tr:hover { background: #fbfdff; }
.table td { overflow-wrap: anywhere; }

.vm-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.vm-page-title { margin: 0; font-size: clamp(1.35rem, 2.3vw, 1.9rem); font-weight: 800; color: var(--vm-slate-950); letter-spacing: -.02em; }
.vm-page-subtitle { margin: 5px 0 0; color: var(--vm-slate-500); font-size: .92rem; }
.vm-section-title { margin: 0 0 14px; font-size: 1.04rem; font-weight: 800; color: var(--vm-slate-800); }
.vm-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.vm-kicker { color: var(--vm-blue); font-weight: 800; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }

.vm-stat-card {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--vm-slate-200);
  border-radius: var(--vm-radius);
  padding: 18px;
  box-shadow: var(--vm-shadow-sm);
}
.vm-stat-card::after {
  content: "";
  position: absolute;
  width: 74px;
  height: 74px;
  right: -22px;
  top: -26px;
  border-radius: 50%;
  background: var(--stat-tint, #eff6ff);
}
.vm-stat-label { color: var(--vm-slate-500); font-size: .86rem; font-weight: 700; margin-bottom: 7px; }
.vm-stat-value { position: relative; z-index: 1; color: var(--vm-slate-950); font-size: clamp(1.28rem, 2.2vw, 1.75rem); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.vm-stat-note { color: var(--vm-slate-500); font-size: .78rem; margin-top: 8px; }
.vm-stat-icon {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--stat-tint, #eff6ff);
  color: var(--stat-color, var(--vm-blue));
  font-size: 1rem;
}

.vm-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
  background: #f1f5f9;
  color: #475569;
}
.vm-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.vm-status.success { color: #166534; background: #dcfce7; }
.vm-status.warning { color: #92400e; background: #fef3c7; }
.vm-status.danger { color: #991b1b; background: #fee2e2; }
.vm-status.info { color: #1d4ed8; background: #dbeafe; }
.vm-status.muted { color: #475569; background: #f1f5f9; }

.vm-empty {
  padding: 52px 18px;
  text-align: center;
  color: var(--vm-slate-500);
}
.vm-empty i { display: block; font-size: 2rem; color: var(--vm-slate-400); margin-bottom: 10px; }

.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }
.action-row, .page-title-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-title-row { justify-content: space-between; }
.text-money { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--vm-slate-950); }
.text-break-anywhere { overflow-wrap: anywhere; word-break: break-word; }
.vm-muted-box { border-radius: 12px; background: var(--vm-slate-50); border: 1px solid var(--vm-slate-200); padding: 14px; }

.vm-chat {
  max-height: 430px;
  overflow: auto;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--vm-slate-200);
  border-radius: var(--vm-radius);
  -webkit-overflow-scrolling: touch;
}
.vm-message { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; max-width: 84%; }
.vm-message:last-child { margin-bottom: 0; }
.vm-message.mine { margin-left: auto; align-items: flex-end; }
.vm-message-head { font-size: .78rem; color: var(--vm-slate-500); }
.vm-message-bubble { background: #fff; border: 1px solid var(--vm-slate-200); border-radius: 13px 13px 13px 4px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.vm-message.mine .vm-message-bubble { background: #eaf2ff; border-color: #cfe0ff; border-radius: 13px 13px 4px 13px; }

.vm-form-panel { max-width: 820px; }
.vm-info-list { margin: 0; }
.vm-info-row { display: grid; grid-template-columns: minmax(110px, 160px) 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf1f5; }
.vm-info-row:last-child { border-bottom: 0; }
.vm-info-label { color: var(--vm-slate-500); font-size: .88rem; }
.vm-info-value { color: var(--vm-slate-900); font-weight: 700; min-width: 0; }

.bi { line-height: 1; }

@media (max-width: 767.98px) {
  body { font-size: 14px; }
  .card-body { padding: 15px; }
  .vm-panel { border-radius: 12px; }
  .vm-page-header { margin-bottom: 17px; gap: 10px; }
  .vm-page-header > .btn, .vm-page-header > a.btn { width: 100%; }
  .table-responsive .table { min-width: 720px; font-size: .88rem; }
  .table-responsive .table.table-sm { min-width: 660px; }
  .vm-chat { max-height: 54vh; }
  .vm-message { max-width: 92%; }
}

@media (max-width: 575.98px) {
  input, select, textarea, .form-control, .form-select { font-size: 16px; }
  .btn:not(.btn-sm) { min-height: var(--vm-touch); }
  .mobile-stack { flex-direction: column !important; align-items: stretch !important; }
  .mobile-stack > *, .mobile-stack form, .mobile-stack .btn { width: 100%; }
  .mobile-full { width: 100%; }
  .vm-stat-card { padding: 15px; }
  .vm-stat-value { font-size: 1.22rem; }
  .vm-stat-icon { width: 31px; height: 31px; right: 12px; top: 12px; }
  .vm-info-row { grid-template-columns: 1fr; gap: 2px; }
}
.min-w-0 { min-width: 0; }
.place-items-center { place-items: center; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Configurable platform brand logo */
.vm-brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; flex: 0 0 auto; background: rgba(255,255,255,.96); }
.portal-login-brand .vm-brand-logo { width: 44px; height: 44px; }

.vm-language-switcher { display:inline-flex; align-items:center; gap:.35rem; margin:0; }
.vm-language-switcher select { border:1px solid rgba(148,163,184,.45); border-radius:.55rem; background:rgba(255,255,255,.94); color:#0f172a; font-size:.78rem; padding:.22rem 1.6rem .22rem .5rem; min-width:6.8rem; }
.seller-area .vm-language-switcher select { background:#fff; color:#0f172a; }
@media (max-width: 991.98px) { .store-topbar-badges .vm-language-switcher { display:inline-flex; } .seller-topbar .vm-language-switcher select { min-width:5.8rem; max-width:7.5rem; } }
