/* =====================================================================
   Auctioneer Crew OS — Core design system
   Shared tokens, resets, buttons, forms, badges, toasts, modals.
   ===================================================================== */

:root {
  --brand:      #e11d2a;
  --brand-2:    #0b1120;
  --accent:     #f4b23e;

  --ink:        #0b1120;
  --ink-soft:   #2b3446;
  --muted:      #64708a;
  --line:       #e4e8f0;
  --bg:         #f6f7fb;
  --card:       #ffffff;
  --white:      #ffffff;

  --ok:         #16a34a;
  --warn:       #d97706;
  --danger:     #dc2626;
  --info:       #2563eb;

  --radius:     14px;
  --radius-sm:  9px;
  --radius-lg:  22px;
  --shadow-sm:  0 1px 2px rgba(11,17,32,.06), 0 1px 3px rgba(11,17,32,.08);
  --shadow:     0 10px 30px -12px rgba(11,17,32,.25);
  --shadow-lg:  0 30px 60px -20px rgba(11,17,32,.35);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Anton", "Oswald", var(--sans);

  --maxw: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { line-height: 1.08; font-weight: 800; letter-spacing: -.01em; }
.display { font-family: var(--display); font-weight: 400; letter-spacing: .01em; text-transform: uppercase; line-height: .98; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.stack > * + * { margin-top: 1rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }

/* ---- Buttons -------------------------------------------------------- */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.15rem; border: 1px solid transparent; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; font-size: .93rem;
  line-height: 1; transition: transform .08s ease, box-shadow .2s ease, background .2s ease, filter .2s ease;
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn.sm { padding: .5rem .8rem; font-size: .82rem; }
.btn.lg { padding: .95rem 1.6rem; font-size: 1.02rem; }
.btn.block { width: 100%; }
.btn-accent  { --btn-bg: var(--accent); --btn-fg: #3a2a00; }
.btn-dark    { --btn-bg: var(--brand-2); }
.btn-ghost   { --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: #fff; border-color: #cfd6e4; }
.btn-outline { --btn-bg: transparent; --btn-fg: var(--brand); border-color: currentColor; box-shadow: none; }
.btn-danger  { --btn-bg: var(--danger); }
.btn-ok      { --btn-bg: var(--ok); }

/* ---- Badges & pills ------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .6rem;
  border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .03em;
  text-transform: uppercase; background: #eef1f7; color: var(--ink-soft);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok      { background: #dcfce7; color: #15803d; }
.badge-pending { background: #fef3c7; color: #b45309; }
.badge-declined{ background: #fee2e2; color: #b91c1c; }
.badge-draft   { background: #e5e7eb; color: #4b5563; }
.badge-scheduled{ background: #dbeafe; color: #1d4ed8; }
.badge-confirmed{ background: #dcfce7; color: #15803d; }
.badge-completed{ background: #e9d5ff; color: #7e22ce; }
.badge-cancelled{ background: #fee2e2; color: #b91c1c; }

/* ---- Forms ---------------------------------------------------------- */
.field { display: block; margin-bottom: 1rem; }
.field > label { display: block; font-weight: 700; font-size: .82rem; margin-bottom: .35rem; color: var(--ink-soft); }
.field .hint { font-size: .76rem; color: var(--muted); margin-top: .3rem; }
.input, .select, .textarea {
  width: 100%; padding: .72rem .85rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease; font-size: .95rem;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(225,29,42,.12);
}
.textarea { min-height: 110px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
@media (max-width: 560px){ .row2, .row3 { grid-template-columns: 1fr; } }

/* ---- Toasts --------------------------------------------------------- */
#toast-wrap {
  position: fixed; z-index: 9999; top: 18px; right: 18px; display: flex; flex-direction: column;
  gap: .6rem; max-width: min(94vw, 380px); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; gap: .7rem; align-items: flex-start;
  background: #fff; border-radius: 12px; padding: .85rem 1rem; box-shadow: var(--shadow-lg);
  border-left: 5px solid var(--info); animation: toast-in .28s cubic-bezier(.2,.8,.2,1);
}
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast .t-msg { font-size: .9rem; font-weight: 600; }
.toast .t-x { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toast-out .2s ease forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ---- Modal ---------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 9000; background: rgba(11,17,32,.55);
  backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; overflow-y: auto; opacity: 0; transition: opacity .18s ease;
}
.modal-backdrop.show { opacity: 1; }
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 640px;
  box-shadow: var(--shadow-lg); transform: translateY(14px) scale(.99);
  transition: transform .22s cubic-bezier(.2,.8,.2,1); overflow: hidden;
}
.modal.wide { max-width: 860px; }
.modal-backdrop.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 1.15rem; }
.modal-head .m-x { margin-left: auto; border: 0; background: #f1f3f8; width: 34px; height: 34px; border-radius: 50%; font-size: 1.1rem; color: var(--muted); }
.modal-head .m-x:hover { background: #e5e8f0; color: var(--ink); }
.modal-body { padding: 1.4rem; max-height: 66vh; overflow-y: auto; }
.modal-foot { display: flex; gap: .6rem; justify-content: flex-end; padding: 1rem 1.4rem; border-top: 1px solid var(--line); background: #fafbfe; }

/* ---- Utility -------------------------------------------------------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap { gap: 1rem; }
.gap-sm { gap: .5rem; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color:#fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg,#eef1f7 25%,#e2e6ef 37%,#eef1f7 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0%{background-position:100% 0} 100%{background-position:-100% 0} }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state svg { width: 54px; height: 54px; margin: 0 auto 1rem; opacity: .5; }
