/* ============================================================
   ORVOS Seller Panel — Shared Base
   Phase 1: Design tokens, button hierarchy, status colors, toasts
   ============================================================ */

/* --- Tokens --- */
:root {
  --s-bg:          #f6f1e6;
  --s-card:        rgba(255, 250, 240, 0.96);
  --s-border:      rgba(168, 134, 66, 0.2);
  --s-border-md:   rgba(168, 134, 66, 0.34);
  --s-gold:        #c6a55c;
  --s-gold-light:  #e0c27a;
  --s-text:        #173029;
  --s-muted:       #64756e;
  --s-radius:      10px;
  --s-radius-lg:   16px;
  --s-h:           44px;

  /* Status colors */
  --s-ok-bg:    rgba(60, 180, 100, 0.12);
  --s-ok-text:  #2f8a4f;
  --s-warn-bg:  rgba(224, 180, 50, 0.14);
  --s-warn-text:#946b16;
  --s-err-bg:   rgba(218, 76, 76, 0.1);
  --s-err-text: #b24c59;
  --s-neu-bg:   rgba(103, 119, 112, 0.1);
  --s-neu-text: #64756e;
}

/* --- Button hierarchy --- */

/* Base reset for all seller buttons */
.s-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--s-h);
  padding: 0 16px;
  border-radius: var(--s-radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
  touch-action: manipulation;
}
.s-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Compatibility aliases for existing seller pages */
.seller-shared-page .btn.primary,
.seller-shared-page .primary,
.seller-shared-page .btn.secondary,
.seller-shared-page .secondary,
.seller-shared-page .btn.danger,
.seller-shared-page .danger,
.seller-shared-page .danger-soft,
.seller-shared-page .btn.ghost,
.seller-shared-page .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--s-h);
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--s-radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: filter 0.15s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

/* Primary — gold fill, ONE per screen section */
.s-btn-primary,
.seller-shared-page .btn.primary,
.seller-shared-page .primary {
  background: var(--s-gold);
  color: #173029;
  border-color: transparent;
}
.s-btn-primary:hover:not(:disabled),
.seller-shared-page .btn.primary:hover:not(:disabled),
.seller-shared-page .primary:hover:not(:disabled) { filter: brightness(1.08); }

/* Secondary — transparent with gold border */
.s-btn-secondary,
.seller-shared-page .btn.secondary,
.seller-shared-page .secondary {
  background: rgba(255, 251, 242, 0.92);
  color: #6f5722;
  border-color: rgba(168, 134, 66, 0.34);
}
.s-btn-secondary:hover:not(:disabled),
.seller-shared-page .btn.secondary:hover:not(:disabled),
.seller-shared-page .secondary:hover:not(:disabled) {
  border-color: var(--s-gold-light);
  background: rgba(255, 244, 214, 0.96);
}

/* Danger — red tint */
.s-btn-danger,
.seller-shared-page .btn.danger,
.seller-shared-page .danger,
.seller-shared-page .danger-soft {
  background: rgba(255, 80, 80, 0.1);
  color: #ff9ba6;
  border-color: rgba(255, 80, 80, 0.3);
}
.s-btn-danger:hover:not(:disabled),
.seller-shared-page .btn.danger:hover:not(:disabled),
.seller-shared-page .danger:hover:not(:disabled),
.seller-shared-page .danger-soft:hover:not(:disabled) {
  background: rgba(255, 80, 80, 0.18);
  border-color: rgba(255, 80, 80, 0.5);
}

/* Ghost — icon-only or low-priority text action */
.s-btn-ghost,
.seller-shared-page .btn.ghost,
.seller-shared-page .ghost {
  background: rgba(255, 250, 242, 0.82);
  border-color: rgba(168, 134, 66, 0.24);
  color: #7b642c;
  padding: 0 12px;
}
.s-btn-ghost:hover:not(:disabled),
.seller-shared-page .btn.ghost:hover:not(:disabled),
.seller-shared-page .ghost:hover:not(:disabled) {
  color: #6f5722;
  border-color: rgba(224, 194, 122, 0.65);
  background: rgba(255, 247, 228, 0.96);
}

/* Small size modifier */
.s-btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.8rem;
}

/* --- Status pills --- */
.s-pill,
.seller-shared-page .status-badge,
.seller-shared-page .badge,
.seller-shared-page .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.s-pill-ok,
.seller-shared-page .status-badge.is-confirmed,
.seller-shared-page .status-badge.is-delivered,
.seller-shared-page .badge.ok,
.seller-shared-page .pill.ok {
  background: var(--s-ok-bg);
  color: var(--s-ok-text);
  border-color: rgba(125, 232, 168, 0.28);
}
.s-pill-warn,
.seller-shared-page .status-badge.is-new,
.seller-shared-page .badge.warn,
.seller-shared-page .pill.warn {
  background: var(--s-warn-bg);
  color: var(--s-warn-text);
  border-color: rgba(232, 208, 122, 0.26);
}
.s-pill-err,
.seller-shared-page .status-badge.is-cancelled,
.seller-shared-page .status-badge.is-archived,
.seller-shared-page .badge.err,
.seller-shared-page .pill.loss {
  background: var(--s-err-bg);
  color: var(--s-err-text);
  border-color: rgba(255, 155, 166, 0.26);
}
.s-pill-neu,
.seller-shared-page .status-badge.is-default,
.seller-shared-page .badge.unknown,
.seller-shared-page .pill:not(.ok):not(.warn):not(.loss) {
  background: var(--s-neu-bg);
  color: var(--s-neu-text);
  border-color: rgba(183, 191, 187, 0.2);
}

/* --- Toast notification system --- */
.s-toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.s-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--s-radius);
  background: rgba(255, 250, 240, 0.98);
  border-left: 3px solid var(--s-gold);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-size: 0.875rem;
  color: var(--s-text);
  pointer-events: auto;
  animation: s-toast-in 0.22s ease;
}
.s-toast.s-toast-ok   { border-left-color: var(--s-ok-text); }
.s-toast.s-toast-warn { border-left-color: var(--s-warn-text); }
.s-toast.s-toast-err  { border-left-color: var(--s-err-text); }
.s-toast.s-toast-out  { animation: s-toast-out 0.2s ease forwards; }

.s-toast-msg { flex: 1; line-height: 1.45; }
.s-toast-close {
  background: none;
  border: none;
  color: var(--s-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  min-height: auto;
}

@keyframes s-toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes s-toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(16px); }
}

@media (max-width: 480px) {
  .s-toast-stack {
    top: auto;
    bottom: 80px;
    right: 12px;
    left: 12px;
    max-width: 100%;
  }
}

/* --- Mobile bottom tab bar --- */
.s-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(9, 26, 21, 0.97);
  border-top: 1px solid rgba(198, 165, 92, 0.22);
  z-index: 900;
  align-items: stretch;
  justify-content: space-around;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.s-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: rgba(183, 191, 187, 0.65);
  font-size: 0.62rem;
  font-weight: 600;
  padding: 6px 4px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.15s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.s-tab.active { color: var(--s-gold); }
.s-tab-icon { font-size: 1.3rem; line-height: 1; }

.s-tab-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 16px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #e05555;
  color: #fff;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}
.s-tab-badge.visible { display: flex; }

/* --- FAB (Floating Action Button) --- */
.s-fab {
  display: none;
  position: fixed;
  bottom: 76px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--s-gold);
  color: #0b211b;
  border: none;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  z-index: 890;
  box-shadow: 0 4px 18px rgba(198, 165, 92, 0.40);
  align-items: center;
  justify-content: center;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.s-fab:hover { filter: brightness(1.1); transform: scale(1.05); }
.s-fab:active { transform: scale(0.95); }

/* --- Skeleton loader --- */
.s-skeleton {
  background: linear-gradient(90deg, rgba(168,134,66,.06) 25%, rgba(168,134,66,.12) 50%, rgba(168,134,66,.06) 75%);
  background-size: 200% 100%;
  animation: s-skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 8px;
  min-height: 16px;
}
.s-skeleton-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(168,134,66,.08);
}
.s-skeleton-row > div {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(168,134,66,.06) 25%, rgba(168,134,66,.12) 50%, rgba(168,134,66,.06) 75%);
  background-size: 200% 100%;
  animation: s-skeleton-pulse 1.5s ease-in-out infinite;
}
@keyframes s-skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Empty state --- */
.s-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--s-muted, #64756e);
}
.s-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}
.s-empty-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.s-empty-subtitle {
  font-size: 0.85rem;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .s-bottom-nav { display: flex; }
  .s-fab { display: flex; }
  body { padding-bottom: 68px !important; }
}
