/* ===== Shared component styles ===== */

/* Buttons */
.btn {
  --bg: var(--surface-2); --fg: var(--text); --bd: var(--border);
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px; line-height: 1;
  padding: 0 14px; height: 38px; border-radius: var(--r-sm);
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  cursor: pointer; white-space: nowrap; transition: all .14s ease; user-select: none;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn.sm { height: 31px; font-size: 12.5px; padding: 0 11px; gap: 6px; }
.btn.lg { height: 46px; font-size: 15px; padding: 0 22px; border-radius: var(--r-md); }
.btn.block { width: 100%; }
.btn-primary { --bg: var(--accent); --fg: #fff; --bd: transparent; box-shadow: 0 6px 20px var(--accent-soft); }
.btn-fire { --bg: var(--fire); --fg: #1a0a02; --bd: transparent; box-shadow: 0 6px 20px var(--fire-soft); }
.btn-discord { --bg: var(--blurple); --fg: #fff; --bd: transparent; box-shadow: 0 6px 20px var(--blurple-soft); }
.btn-ghost { --bg: transparent; --bd: transparent; --fg: var(--text-dim); }
.btn-ghost:hover { --fg: var(--text); background: var(--surface-2); }
.btn-outline { --bg: transparent; --bd: var(--border-strong); }
.btn-danger { --bg: var(--red-soft); --fg: var(--red); --bd: transparent; }
.btn-success { --bg: var(--green); --fg: #04140b; --bd: transparent; }

/* Badges & pills */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  letter-spacing: .02em; padding: 3px 8px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
  font-family: var(--font-body); text-transform: none; white-space: nowrap;
}
.badge.dot::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
.badge-free { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge-paid { background: var(--surface-2); color: var(--text-dim); }
.badge-success { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge-warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge-danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }

/* Inputs */
.field-label { display:block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.input, .select, .textarea {
  width: 100%; background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 0 12px; height: 40px; font-size: 14px; outline: none; transition: border-color .14s, box-shadow .14s;
}
.textarea { padding: 10px 12px; height: auto; min-height: 90px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}

/* Switch */
.switch { position: relative; width: 40px; height: 23px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border); cursor: pointer; transition: background .16s; flex: none; }
.switch.on { background: var(--accent); border-color: transparent; }
.switch::after { content:""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .16s; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.switch.on::after { transform: translateX(17px); }

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th { text-align: left; font-weight: 600; color: var(--text-faint); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; padding: 0 16px 11px; }
.tbl tbody td { padding: 13px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }

/* Misc */
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sh-shimmer 1.3s infinite; border-radius: var(--r-sm); }

/* Placeholder thumbnail */
.thumb {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, rgba(255,255,255,.022) 11px 22px),
    radial-gradient(120% 120% at 20% 0%, color-mix(in oklab, var(--thumb-accent, var(--accent)) 26%, transparent), transparent 60%),
    var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.thumb .thumb-tag { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); letter-spacing: .04em; }

/* Tooltip */
.tip { position: relative; }
.tip-pop {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--surface-3); color: var(--text); font-size: 12px; padding: 6px 9px;
  border-radius: var(--r-xs); white-space: nowrap; border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md); pointer-events: none; z-index: 60;
}

/* Toasts */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 11px; min-width: 280px; max-width: 380px;
  background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 13px 15px; box-shadow: var(--shadow-lg); animation: sh-fade-up .25s ease;
}

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(4,5,8,.62); backdrop-filter: blur(5px); z-index: 150; display: flex; align-items: center; justify-content: center; padding: 24px; animation: sh-fade .16s ease; }
.modal { width: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: sh-scale-in .2s cubic-bezier(.2,.8,.3,1); max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.empty { text-align: center; padding: 54px 20px; color: var(--text-faint); }

.spin-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: sh-spin .7s linear infinite; display: inline-block; flex: none; opacity: .9; }
