/*
  YD DISTRIBUTION — Global Theme (Light)
  - โทนสีอิงจากหน้า Pricing/Services (พื้นหลังสว่าง อ่านง่าย)
  - คงชื่อคลาสเดิมไว้ (btn-purple, card-yd, ฯลฯ) เพื่อไม่กระทบโค้ด
*/

:root {
  --bg0: #f6f8fc;
  --bg1: #ffffff;
  --card: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --brand: #03338a;
  --brand-rgb: 3, 51, 138;
  --primary: var(--brand);
  --cyan: #0ea5e9;
  --purple: var(--primary); /* backward-compat */
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --radius2: 22px;
  --soft: rgba(15, 23, 42, 0.03);
  --font: "Prompt", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

html,
body {
  min-height: 100%;
}
body {
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(
      1200px 800px at 8% 10%,
      rgba(3, 51, 138, 0.12),
      transparent 55%
    ),
    radial-gradient(
      900px 700px at 86% 18%,
      rgba(14, 165, 233, 0.1),
      transparent 55%
    ),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  color: var(--text);
}

/* YD: Dropdown icon color (use brand as default) */
.yd-dd .bi {
  color: var(--brand);
}
.yd-dd .yd-dd-menu .yd-dd-item .bi {
  color: var(--brand);
}

/* YD: SweetAlert2 icon color to match brand */
.swal2-icon.swal2-info,
.swal2-icon.swal2-question,
.swal2-icon.swal2-warning {
  border-color: var(--brand) !important;
  color: var(--brand) !important;
}

/* Prompt everywhere */
button,
input,
select,
textarea,
.btn,
.nav-link,
.dropdown-item {
  font-family: var(--font) !important;
}

a {
  color: inherit;
}
.small-muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.navbar-yd {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1030;
}
body.has-nav {
  padding-top: var(--yd-nav-h, 64px);
}
.sidebar {
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--border);
  min-height: 100vh;
}

/* =========================
   Sidebar (Nav)
   ========================= */
.sidebar .sb-head {
  margin: 14px 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.sidebar .sb-head i {
  color: var(--primary);
}
.sidebar .sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.05s ease;
}
.sidebar .sb-item i {
  width: 18px;
  text-align: center;
}
.sidebar .sb-item:hover {
  background: rgba(var(--brand-rgb), 0.06);
  border-color: rgba(var(--brand-rgb), 0.1);
}
.sidebar .sb-item:active {
  transform: translateY(1px);
}
.sidebar .sb-item.active {
  background: rgba(var(--brand-rgb), 0.1);
  border-color: rgba(var(--brand-rgb), 0.22);
  font-weight: 800;
}
.card-yd {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}

/* Notes / inline alerts (used across App pages: payouts, settings, etc.) */
.yd-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius2);
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.7);
}
.yd-note .bi {
  font-size: 20px;
  margin-top: 1px;
}
.yd-note-info {
  background: rgba(var(--brand-rgb), 0.08);
  border-color: rgba(var(--brand-rgb), 0.18);
}
.yd-note-info .bi {
  color: rgba(var(--brand-rgb), 1);
}
.yd-note-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: #0f172a;
}
.yd-note-warning .bi {
  color: #b45309;
}
.yd-note-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
}
.yd-note-danger .bi {
  color: rgba(239, 68, 68, 1);
}

/* Success variant (used in OTP/email-change flows, confirmations, etc.) */
.yd-note-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.24);
  color: #0f172a;
}
.yd-note-success .bi {
  color: rgba(34, 197, 94, 1);
}

/* Admin settings tiles (used in /admin/system/* pages) */
.yd-setting-tile {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius2);
  padding: 14px 14px;
}
.yd-setting-tile__head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.yd-setting-tile__icon {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--brand-rgb), 0.1);
  border: 1px solid rgba(var(--brand-rgb), 0.18);
  flex: 0 0 auto;
}
.yd-setting-tile__icon .bi {
  color: rgba(var(--brand-rgb), 1) !important;
  font-size: 18px;
}
.yd-setting-tile__title {
  font-weight: 900;
  line-height: 1.15;
}
.yd-setting-tile .form-check-label {
  font-weight: 800;
}

/* Colored dots (used in custom dropdowns like /admin/system/announcements) */
.yd-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 0 1px rgba(15, 23, 42, 0.14);
}
.yd-dot--danger {
  background: #ef4444;
}
.yd-dot--brand {
  background: var(--brand);
}
.yd-dot--warning {
  background: #f59e0b;
}
.yd-dot--success {
  background: #22c55e;
}
.yd-dot--info {
  background: #0ea5e9;
}

.btn-yd {
  border-radius: 14px;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}
.btn-purple {
  color: #fff;
  border: 1px solid rgba(var(--brand-rgb), 0.14);
  background: linear-gradient(
    135deg,
    rgba(var(--brand-rgb), 1) 0%,
    rgba(var(--brand-rgb), 0.86) 100%
  );
  box-shadow: 0 10px 22px rgba(var(--brand-rgb), 0.18);
}

/* brand text utility */
.text-brand {
  color: var(--brand) !important;
}

/* SweetAlert2 theme: force icon to brand blue */
.swal2-icon.swal2-info,
.swal2-icon.swal2-question {
  border-color: var(--brand) !important;
  color: var(--brand) !important;
}
.swal2-icon.swal2-info [class^="swal2-i"],
.swal2-icon.swal2-question [class^="swal2-"] {
  color: var(--brand) !important;
}

/* Brand primary button (solid #03338a) */
.btn-brand-yd {
  color: #fff;
  border: 1px solid rgba(var(--brand-rgb), 0.14);
  background: var(--brand);
  box-shadow: 0 10px 22px rgba(var(--brand-rgb), 0.18);
}
.btn-brand-yd,
.btn-brand-yd:hover,
.btn-brand-yd:focus,
.btn-brand-yd:focus-visible,
.btn-brand-yd:active {
  /* force same look across states */
  background: var(--brand) !important;
  color: #fff !important;
}

/* ensure ALL icons inside solid brand buttons are white */
.btn-brand-yd,
.btn-brand-yd * {
  color: #fff !important;
}
.btn-brand-yd i,
.btn-brand-yd .bi,
.btn-brand-yd .fa,
.btn-brand-yd .material-icons {
  color: #fff !important;
}
.btn-brand-yd svg,
.btn-brand-yd svg * {
  fill: #fff !important;
  stroke: #fff !important;
  color: #fff !important;
}

.btn-brand-yd:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(var(--brand-rgb), 0.22);
}

/* =========================
   Pagination (Brand)
   ========================= */
.pagination {
  gap: 6px;
}
.pagination .page-link {
  border-radius: 12px;
  padding: 0.48rem 0.78rem;
  font-weight: 600;
  color: var(--brand);
  border-color: rgba(var(--brand-rgb), 0.16);
}
.pagination .page-link:hover {
  color: var(--brand);
  background: rgba(var(--brand-rgb), 0.08);
  border-color: rgba(var(--brand-rgb), 0.26);
}
.pagination .page-link:focus {
  box-shadow: 0 0 0 0.22rem rgba(var(--brand-rgb), 0.18);
}
.pagination .page-item.active .page-link,
.pagination .page-item.active .page-link:hover,
.pagination .page-item.active .page-link:focus {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 10px 18px rgba(var(--brand-rgb), 0.18);
}
.btn-brand-yd:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(var(--brand-rgb), 0.16);
}

/* Theme text color helper */
.text-brand-yd {
  color: var(--brand) !important;
}

.btn-danger-yd {
  color: #fff;
  border: 1px solid rgba(239, 68, 68, 0.18);
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 1) 0%,
    rgba(239, 68, 68, 0.86) 100%
  );
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.18);
}
.btn-danger-yd .bi {
  color: #fff !important;
}
/* SweetAlert2: force icon/text to be white inside danger confirm button */
.swal2-confirm.btn-danger-yd,
.swal2-confirm.btn-danger {
  color: #fff !important;
}
.swal2-confirm.btn-danger-yd .bi,
.swal2-confirm.btn-danger-yd i,
.swal2-confirm.btn-danger-yd svg,
.swal2-confirm.btn-danger .bi,
.swal2-confirm.btn-danger i,
.swal2-confirm.btn-danger svg {
  color: #fff !important;
  fill: #fff !important;
}
.btn-danger-yd:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.22);
}
.btn-danger-yd:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.16);
}

/* =========================
   Support / Tickets Chat UI
   - ยึดผู้ใช้งาน (มุมมองปัจจุบัน) อยู่ขวาเสมอ
   - อีกฝั่งเป็นสีน้ำเงินอ่อนตามธีม
   ========================= */
.yd-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: 6px;
}
.yd-chat-row {
  display: flex;
}
.yd-chat-row.mine {
  justify-content: flex-end;
}
.yd-chat-row.other {
  justify-content: flex-start;
}

.yd-chat-bubble {
  max-width: min(760px, 82%);
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
.yd-chat-row.mine .yd-chat-bubble {
  background: rgba(var(--brand-rgb), 0.06);
  border-color: rgba(var(--brand-rgb), 0.18);
}
.yd-chat-row.other .yd-chat-bubble {
  background: rgba(0, 91, 255, 0.08);
  border-color: rgba(0, 91, 255, 0.18);
}

.yd-chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.yd-chat-row.mine .yd-chat-meta {
  flex-direction: row-reverse;
}

.yd-chat-name {
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.yd-chat-name i {
  color: var(--primary);
}
.yd-chat-row.mine .yd-chat-name i {
  color: var(--primary);
}

.yd-chat-time {
  color: var(--muted);
  white-space: nowrap;
}
.yd-chat-msg {
  white-space: pre-wrap;
}

/* scrollbar (match theme) */
.yd-chat::-webkit-scrollbar {
  width: 10px;
}
.yd-chat::-webkit-scrollbar-thumb {
  background: rgba(var(--brand-rgb), 0.25);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
.yd-chat {
  scrollbar-color: rgba(var(--brand-rgb), 0.3) transparent;
  scrollbar-width: thin;
}
.btn-purple .bi {
  color: #fff;
}
.btn-purple:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(var(--brand-rgb), 0.22);
}
.btn-purple:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(var(--brand-rgb), 0.16);
}

/* CTA button sizing used in profile header */
.yd-btn-cta {
  min-width: 132px;
  justify-content: center;
}
.btn-outline-yd {
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #fff;
  color: var(--text);
}
.btn-outline-yd .bi {
  color: var(--primary);
}
/* allow contextual icon colors inside outline buttons (e.g. delete icon) */
.btn-outline-yd .bi.text-danger {
  color: rgba(239, 68, 68, 1);
}
.btn-outline-yd:hover {
  background: #f1f5f9;
}

/* Danger outline button (theme consistent) */
.btn-outline-danger-yd {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: #fff;
  color: rgba(239, 68, 68, 1);
}
.btn-outline-danger-yd .bi {
  color: rgba(239, 68, 68, 1);
}
.btn-outline-danger-yd:hover {
  background: rgba(239, 68, 68, 0.06);
}

.badge-soft {
  border: 1px solid rgba(3, 51, 138, 0.18);
  background: rgba(3, 51, 138, 0.07);
  color: rgba(var(--brand-rgb), 0.96);
  font-weight: 600;
}

.badge-soft .bi {
  color: rgba(var(--brand-rgb), 0.96);
}

/* Ticket category badge (Support) — blue outline like the ticket list mock */
.yd-ticket-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(var(--brand-rgb), 0.22);
  background: rgba(var(--brand-rgb), 0.06);
  color: rgba(var(--brand-rgb), 0.98);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.yd-ticket-cat-ic {
  color: rgba(var(--brand-rgb), 0.98);
}
.yd-ticket-cat-txt {
  line-height: 1.2;
}
.yd-ticket-cat-ref {
  margin-left: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--brand-rgb), 0.18);
  background: rgba(var(--brand-rgb), 0.08);
  color: rgba(var(--brand-rgb), 0.98);
  font-size: 12px;
}
/* Make all badges medium-bold for readability */
/* Global weights: badges + pills should be medium-bold (readable, consistent) */
.badge {
  font-weight: 600 !important;
}
.yd-badge {
  font-weight: 600 !important;
}
.yd-pill {
  font-weight: 600 !important;
}
.dash-pill {
  font-weight: 600 !important;
}

/* =========================
   Status badges (Dashboard-style) — reusable
   ========================= */
.yd-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  border: 1px solid var(--border);
  color: rgba(15, 23, 42, 0.85);
  background: rgba(2, 6, 23, 0.04);
  white-space: nowrap;
}
.yd-badge.yd-badge-draft {
  background: rgba(var(--brand-rgb), 0.06);
  color: rgba(var(--brand-rgb), 0.98);
  border-color: rgba(var(--brand-rgb), 0.18);
}
.yd-badge.yd-badge-warn {
  background: rgba(245, 158, 11, 0.12);
  color: rgba(120, 53, 15, 0.95);
  border-color: rgba(245, 158, 11, 0.25);
}
.yd-badge.yd-badge-ok {
  background: rgba(34, 197, 94, 0.12);
  color: rgba(21, 128, 61, 0.95);
  border-color: rgba(34, 197, 94, 0.25);
}
.yd-badge.yd-badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: rgba(127, 29, 29, 0.95);
  border-color: rgba(239, 68, 68, 0.25);
}

/* =========================
   Hold Collab Split — quick allocation bar
   (prevents "squeezed" look between button + total badge)
   ========================= */
.hold-split-actions {
  /* sits on the right of "Release Owner" row */
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.hold-split-actions .small-muted {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.hold-split-quickbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  width: auto;
  max-width: 100%;

  /* subtle container so it doesn't look "floating" */
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.03);
}
@media (min-width: 576px) {
  .hold-split-quickbar {
    flex-wrap: nowrap;
  }
}
.hold-split-quickbar .btn {
  white-space: nowrap;
  min-height: 38px;
}
.hold-split-total {
  /* make the total pill feel aligned with buttons */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.375rem 0.75rem;
  font-size: 12.5px;
  font-weight: 800;
  border-radius: 999px;
}

/* =========================
   Action buttons (Dashboard-style) — reusable
   ========================= */
.action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.btn-icon-yd {
  width: 42px;
  height: 42px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.08);
}
.btn-icon-yd i {
  font-size: 16px;
  line-height: 0;
}
.btn-icon-yd.btn-outline-yd {
  background: #fff;
}
.btn-icon-yd.btn-outline-yd:hover {
  background: #f1f5f9;
}

/* Delete buttons: keep theme, but make trash icon red everywhere */
.btn .bi-trash,
.btn .bi-trash-fill,
.btn .bi-trash3,
.btn .bi-trash3-fill {
  color: rgba(239, 68, 68, 1) !important;
}

/* Form */
.form-label {
  font-weight: 600;
}
.form-control,
.form-select {
  background: #fff !important;
  border: 1px solid rgba(15, 23, 42, 0.18) !important;
  color: var(--text) !important;
  border-radius: 14px !important;
  padding: 0.65rem 0.85rem !important;
}
.form-control::placeholder {
  color: rgba(100, 116, 139, 0.75);
}
.form-control:focus,
.form-select:focus {
  border-color: rgba(3, 51, 138, 0.55) !important;
  box-shadow: 0 0 0 0.2rem rgba(3, 51, 138, 0.14) !important;
}

hr.hr-yd {
  border-color: var(--border);
  opacity: 1;
}

/* Table */
.table-yd {
  color: var(--text);
}
.table-yd th,
.table-yd td {
  border-color: var(--border);
}

/* Toast (top-right, solid, smooth) */
.toast-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  width: min(360px, calc(100vw - 32px));
}
.toast-yd {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.toast-yd .t-title {
  font-weight: 700;
}
.toast-yd .t-msg {
  color: var(--muted);
  font-size: 0.92rem;
}

/* KPI cards */
.kpi {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.kpi .k {
  flex: 1;
  min-width: 160px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--soft);
}
.k .v {
  font-size: 1.3rem;
  font-weight: 800;
}
.k .l {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Purple subtle helpers (Bootstrap doesn't have this out of the box) */
.text-purple {
  color: var(--purple) !important;
}
.bg-purple-subtle {
  background: rgba(168, 85, 247, 0.12) !important;
}
.border-purple-subtle {
  border-color: rgba(168, 85, 247, 0.35) !important;
}

/* Light-mode friendly subtle helpers */
.bg-info-subtle-yd {
  background: rgba(14, 165, 233, 0.08) !important;
}
.bg-primary-subtle-yd {
  background: rgba(3, 51, 138, 0.08) !important;
}
.text-primary {
  color: var(--primary) !important;
}
.text-info {
  color: var(--primary) !important;
}

/* Small readable boxes */
.mini-box {
  border: 1px solid var(--border);
  background: var(--soft);
  border-radius: var(--radius);
  padding: 14px;
}
.mini-pre {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #0b1020;
  color: #e5e7eb;
  font-size: 0.88rem;
  line-height: 1.45;
  overflow: auto;
  max-height: 320px;
}

/* Alert skin */
.alert-yd {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
}

/* Offcanvas (Bootstrap) — force readable light UI */
.offcanvas.text-bg-dark {
  background: rgba(255, 255, 255, 0.98) !important;
  color: var(--text) !important;
}
.offcanvas.text-bg-dark .btn-close {
  filter: none !important;
}

@media (max-width: 992px) {
  .sidebar {
    min-height: auto;
  }
}

/* =========================
   Brand icon color (YD)
   ========================= */
/* Override Bootstrap's text-info to match brand (#03338a) */
.text-info {
  color: var(--primary) !important;
}

/* Default icon tint inside UI elements */
.sidebar i.bi,
.card-yd i.bi,
.navbar i.bi {
  color: var(--primary);
}
/* Keep icons readable on purple buttons */
.btn-purple i.bi,
.btn-purple .bi {
  color: #fff;
}

/* ✅ Icons on Bootstrap primary buttons must be white (blue buttons) */
.btn-primary .bi,
.btn-primary i.bi {
  color: #fff;
}

/* Brand icon color */
.bi {
  color: var(--primary);
}

/* =========================
   Inline Success Banner (Release Submit)
   ========================= */
.yd-inline-ok {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: linear-gradient(
    180deg,
    rgba(34, 197, 94, 0.12),
    rgba(15, 23, 42, 0.02)
  );
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
}
.yd-inline-ok__icon {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.22);
}
.yd-inline-ok__icon::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 2px solid rgba(34, 197, 94, 0.22);
  animation: ydpulse 1.15s ease-out infinite;
}
.yd-inline-ok__icon .bi {
  font-size: 22px;
  color: #16a34a;
  animation: yd-icon-pop 0.38s ease-out;
}
.yd-inline-ok__title {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.2px;
}
.yd-inline-ok__desc {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 2px;
}
@keyframes ydpulse {
  0% {
    transform: scale(0.78);
    opacity: 0.85;
  }
  65% {
    transform: scale(1.22);
    opacity: 0;
  }
  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}
@keyframes yd-icon-pop {
  0% {
    transform: scale(0.55);
    opacity: 0;
  }
  55% {
    transform: scale(1.12);
    opacity: 1;
  }
  80% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}

/* =========================
   SweetAlert2 (match YD theme)
   ========================= */
.swal2-container {
  backdrop-filter: blur(2px);
}
.swal2-popup.yd-swal {
  border-radius: 22px !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
  font-family: var(--font) !important;
}
.swal2-title {
  font-weight: 900 !important;
  color: var(--text) !important;
  letter-spacing: -0.2px;
}
.swal2-html-container,
.swal2-content {
  color: rgba(15, 23, 42, 0.78) !important;
  font-size: 1rem !important;
  line-height: 1.55 !important;
}
.swal2-icon.swal2-warning {
  border-color: rgba(239, 68, 68, 0.55) !important;
  color: rgba(239, 68, 68, 1) !important;
}
.swal2-icon.swal2-question {
  border-color: rgba(var(--brand-rgb), 0.45) !important;
  color: rgba(var(--brand-rgb), 1) !important;
}
.swal2-actions {
  gap: 10px !important;
}

/* =========================
   Inline URL (Promo Links)
   - Keep Copy/Open buttons in the same row while URL can wrap
   ========================= */
.yd-url-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.yd-url-line .yd-url-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

/* Table header: keep icon + label on the same line (used in /app/dashboard, /app/releases, /app/tracks) */
.yd-th {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.yd-th i {
  display: inline-block !important;
  width: auto !important;
  line-height: 1;
}

/* =========================
   KPI Cards (Promo-like dashboards)
   - shared across Releases / Tracks / Assets
   ========================= */
.promo-kpi-card {
  position: relative;
  overflow: hidden;
}
.promo-kpi-badge {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--brand-rgb), 0.1);
  border: 1px solid rgba(var(--brand-rgb), 0.16);
  flex: 0 0 auto;
}
.promo-kpi-badge i {
  font-size: 1.05rem;
}

/* =========================================================
   YD Icon Dropdown (enhanced <select>)
========================================================= */
.yd-dd {
  position: relative;
}
.yd-dd-native {
  display: none !important;
}
.yd-dd-btn {
  text-align: left;
}
.yd-dd-left {
  min-width: 0;
}
.yd-dd-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yd-dd-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  padding: 6px;
  z-index: 1060;
  max-height: 320px;
  overflow: auto;
  display: none;
}
.yd-dd.open .yd-dd-menu {
  display: block;
}

.yd-dd-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.yd-dd-item .bi {
  opacity: 0.9;
}
.yd-dd-item:hover {
  background: rgba(var(--brand-rgb), 0.08);
}
.yd-dd-item.active {
  background: rgba(var(--brand-rgb), 0.12);
  border: 1px solid rgba(var(--brand-rgb), 0.18);
}
.yd-dd-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Notifications (navbar bell) */
.yd-noti-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  background: #ef4444;
  box-shadow: none;
}

/* Disabled enhanced dropdown (native <select disabled> is hidden) */
.yd-dd.yd-dd-disabled .yd-dd-btn {
  opacity: 0.85;
  cursor: not-allowed;
}
.yd-dd.yd-dd-disabled .yd-dd-menu {
  display: none !important;
}

/* =========================================================
   YD Icon Dropdown (enhanced <select>)
========================================================= */
.yd-dd {
  position: relative;
}
.yd-dd-native {
  display: none !important;
}
.yd-dd-btn {
  text-align: left;
}
.yd-dd-left {
  min-width: 0;
}
.yd-dd-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yd-dd-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  padding: 6px;
  z-index: 1060;
  max-height: 320px;
  overflow: auto;
  display: none;
}
.yd-dd.open .yd-dd-menu {
  display: block;
}

.yd-dd-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.yd-dd-item .bi {
  opacity: 0.9;
}
.yd-dd-item:hover {
  background: rgba(var(--brand-rgb), 0.08);
}
.yd-dd-item.active {
  background: rgba(var(--brand-rgb), 0.12);
  border: 1px solid rgba(var(--brand-rgb), 0.18);
}
.yd-dd-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Admin Users: keep layout stable (no broken vertical text) =====
   Notes:
   - The users table is inside .table-responsive and may scroll horizontally on smaller screens.
   - Avoid table-layout:fixed + word-break:break-word here, because it can compress columns and
     make headers/values wrap character-by-character ("Last Login" becomes vertical).
*/
.admin-users-page {
  overflow-x: visible;
}
.admin-users-page .table-yd {
  width: 100%;
  table-layout: auto;
}
.admin-users-page .table-yd th,
.admin-users-page .table-yd td {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

/* ===== Post-login Announcement Popup ===== */
.yd-announce-modal {
  border-radius: 18px;
  overflow: hidden;
}
.yd-announce {
  padding: 18px 18px 14px;
}
.yd-announce__top {
  text-align: center;
  padding: 6px 8px 10px;
}
.yd-announce__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.18);
}
.yd-announce__icon i {
  font-size: 24px;
}
.yd-announce__icon--danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}
.yd-announce__icon--brand {
  background: rgba(var(--brand-rgb), 0.1);
  border-color: rgba(var(--brand-rgb), 0.18);
  color: var(--brand);
}
.yd-announce__icon--warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.22);
  color: #f59e0b;
}
.yd-announce__icon--success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.22);
  color: #22c55e;
}
.yd-announce__icon--info {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.22);
  color: #3b82f6;
}

.yd-announce__title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}
.yd-announce__subtitle {
  margin-top: 6px;
  color: rgba(100, 116, 139, 0.95);
  font-size: 0.95rem;
}
.yd-announce__body {
  padding: 12px 14px 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  margin-top: 10px;
}
.yd-announce__body .small-muted {
  color: rgba(100, 116, 139, 0.95);
}
.yd-announce__body ul {
  padding-left: 18px;
}
.yd-announce__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 14px;
}
.yd-announce__footer .form-check-label {
  color: rgba(100, 116, 139, 0.95);
}
@media (max-width: 576px) {
  .yd-announce__footer {
    flex-direction: column;
    align-items: stretch;
  }
  .yd-announce__footer .btn {
    width: 100%;
  }
}

/* =========================================================
   Broadcast Channel Cards + Popup
========================================================= */
.yd-channel-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius2);
  padding: 14px 14px;
  cursor: pointer;
  position: relative;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
}
.yd-channel-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.08);
}
.yd-channel-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--brand-rgb), 0.1);
  border: 1px solid rgba(var(--brand-rgb), 0.18);
  flex: 0 0 auto;
}
.yd-channel-card__icon .bi {
  font-size: 20px;
  color: rgba(var(--brand-rgb), 1);
}
.yd-channel-card__title {
  font-weight: 900;
  line-height: 1.1;
}
.yd-channel-card__sub {
  font-weight: 700;
  opacity: 0.85;
}
.yd-channel-card__check {
  margin-left: auto;
  padding-top: 6px;
}
.yd-channel-card--hot {
  border-color: rgba(var(--brand-rgb), 0.22);
  box-shadow: 0 10px 22px rgba(var(--brand-rgb), 0.1);
}

.yd-broadcast-msg {
  white-space: normal;
  line-height: 1.65;
  font-size: 16px;
  background: rgba(2, 6, 23, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius2);
  padding: 14px 14px;
}

.yd-modal-broadcast .modal-content {
  border-radius: 22px;
}
.yd-modal-broadcast__hero {
  background:
    radial-gradient(
      1200px 240px at 0% 0%,
      rgba(var(--brand-rgb), 0.14),
      transparent 60%
    ),
    radial-gradient(
      900px 240px at 100% 0%,
      rgba(59, 130, 246, 0.1),
      transparent 55%
    ),
    rgba(255, 255, 255, 0.8);
}

/* Broadcast user picker */
.yd-userpick-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.1);
  flex: 0 0 auto;
}
.yd-userpick-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.yd-userpick-avatar .bi {
  font-size: 22px;
  opacity: 0.75;
}

.yd-userpick-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.1);
  flex: 0 0 auto;
}
.yd-userpick-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.yd-userpick-avatar-sm .bi {
  font-size: 18px;
  opacity: 0.75;
}

.yd-notif-menu {
  width: min(420px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
}
.yd-notif-menu .dropdown-item {
  white-space: normal;
}
.yd-notif-menu .yd-notif-item-title,
.yd-notif-menu .yd-notif-item-msg,
.yd-notif-menu .small-muted {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 575.98px) {
  .yd-notif-menu {
    position: fixed !important;
    inset: 72px 12px auto 12px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    transform: none !important;
    margin: 0 !important;
    max-height: calc(100vh - 96px);
    overflow: auto;
  }
  .yd-notif-menu .dropdown-item {
    padding-left: 12px;
    padding-right: 12px;
  }
  .yd-notif-menu
    > li.px-3.py-2.d-flex.align-items-center.justify-content-between.gap-2 {
    flex-wrap: wrap;
  }
  .yd-notif-menu .btn {
    width: 100%;
    justify-content: center;
  }
  .yd-notif-menu form.m-0 {
    width: 100%;
  }
}


/* YD release date picker */
.yd-date-wrap{position:relative;display:block;width:100%;}
.yd-date-picker-btn{position:absolute;right:10px;top:50%;transform:translateY(-50%);border:0;background:transparent;padding:4px 6px;line-height:1;color:var(--brand);cursor:pointer;z-index:3;}
.yd-date-picker-btn:hover{opacity:1;}
.yd-date-wrap input[data-yd-date-field="1"]{padding-right:44px !important;}
.yd-date-native{position:absolute;right:8px;top:50%;transform:translateY(-50%);width:36px;height:36px;opacity:0;cursor:pointer;z-index:4;border:0;padding:0;margin:0;}
.yd-date-native::-webkit-calendar-picker-indicator{opacity:0;display:block;width:100%;height:100%;cursor:pointer;}


/* ===== Admin nav shared layout (match Affiliate exactly) ===== */

.yd-admin-nav,
.fin-admin-nav,
.aff-admin-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.yd-admin-nav__item,
.fin-admin-nav__item,
.aff-admin-nav__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  min-height: 88px;
  text-decoration: none;
  color: #0f172a;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 16px 40px rgba(15,23,42,.05);
}
.yd-admin-nav__item:hover,
.fin-admin-nav__item:hover,
.aff-admin-nav__item:hover {
  color: #0f172a;
  transform: translateY(-1px);
}
.yd-admin-nav__icon,
.fin-admin-nav__icon,
.aff-admin-nav__icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #eef4ff;
  color: #123e97;
  box-shadow: inset 0 0 0 1px rgba(59,130,246,.12);
  font-size: 20px;
}
.yd-admin-nav__title,
.fin-admin-nav__title,
.aff-admin-nav__title {
  display: block;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
}
.yd-admin-nav__sub,
.fin-admin-nav__sub,
.aff-admin-nav__sub {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}
.yd-admin-nav__count,
.fin-admin-nav__count,
.aff-admin-nav__count {
  margin-left: auto;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(59,130,246,.18);
  background: #f8fbff;
  color: #123e97;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1399.98px) {
  .yd-admin-nav,
  .fin-admin-nav,
  .aff-admin-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .yd-admin-nav,
  .fin-admin-nav,
  .aff-admin-nav { grid-template-columns: 1fr; }
}

/* ===== Admin nav active-state shared ===== */

.yd-admin-nav__item.is-active,
.fin-admin-nav__item.is-active,
.aff-admin-nav__item.is-active {
  border-color: rgba(var(--brand-rgb), .22) !important;
  box-shadow: 0 20px 48px rgba(var(--brand-rgb), .10) !important;
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .08), #fff) !important;
}
.yd-admin-nav__item.is-active:hover,
.fin-admin-nav__item.is-active:hover,
.aff-admin-nav__item.is-active:hover {
  color: #0f172a;
}
.yd-admin-nav__item.is-active .yd-admin-nav__count,
.fin-admin-nav__item.is-active .fin-admin-nav__count,
.aff-admin-nav__item.is-active .aff-admin-nav__count {
  background: rgba(var(--brand-rgb), .10) !important;
  border-color: rgba(var(--brand-rgb), .22) !important;
}
.yd-admin-nav__item.is-active .yd-admin-nav__icon,
.fin-admin-nav__item.is-active .fin-admin-nav__icon,
.aff-admin-nav__item.is-active .aff-admin-nav__icon {
  background: rgba(var(--brand-rgb), .10) !important;
  color: rgba(var(--brand-rgb), 1) !important;
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), .18) !important;
}

/* AJAX pagination core */
[data-yd-ajax-list] {
  position: relative;
  transition: opacity .18s ease;
}
[data-yd-ajax-list].is-loading {
  opacity: .72;
}
[data-yd-ajax-list].is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,.35);
  pointer-events: none;
}
.yd-pager__meta {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.yd-pager__navs {
  align-items: center;
}
.yd-pager__btn {
  min-width: 42px;
  min-height: 42px;
  justify-content: center;
  padding: .55rem .8rem;
}
.yd-pager__arrow {
  padding-inline: .72rem;
}
.yd-pager__arrow .bi {
  font-size: .98rem;
  line-height: 1;
  color: var(--text) !important;
}
.yd-pager__btn.disabled,
.yd-pager__btn[aria-disabled="true"] {
  opacity: .58;
  pointer-events: none;
  box-shadow: none;
}
.yd-pager__btn.btn-outline-yd {
  background: #fff;
  color: var(--text);
}
.yd-pager__btn.btn-outline-yd:hover {
  background: #f8fafc;
}
