/* ── Custom scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #DFD5C3; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #CBBDA5; }

/* ── Confidence bar ───────────────────────────────────────── */
.confidence-bar {
  height: 5px;
  background: #ECE5D8;
  border-radius: 99px;
  overflow: hidden;
}
.conf-fill { height: 100%; transition: width .5s cubic-bezier(0.4, 0, 0.2, 1); }

/* ── Dropdown ─────────────────────────────────────────────── */
.dropdown-menu {
  transform-origin: top right;
  transition: opacity .15s ease, transform .15s ease;
}
.dropdown-menu.closed {
  opacity: 0;
  pointer-events: none;
  transform: scale(.96) translateY(-6px);
}
.dropdown-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

/* ── SweetAlert2 ──────────────────────────────────────────── */
.swal2-popup {
  border-radius: 20px !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  padding: 28px !important;
  background: #FFFFFF !important;
  border: 1px solid #ECE5D8 !important;
  box-shadow: 0 25px 60px -15px rgba(22, 44, 70, 0.18) !important;
}
.swal2-title {
  font-family: 'Outfit', sans-serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #162C46 !important;
}
.swal2-html-container { font-size: 14px !important; color: #627D98 !important; }
.swal2-confirm {
  background: #B84A39 !important;
  color: #FFFFFF !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  padding: 10px 22px !important;
  box-shadow: 0 4px 12px rgba(184, 74, 57, 0.25) !important;
  transition: all .15s ease !important;
}
.swal2-confirm:hover {
  background: #96392B !important;
  transform: translateY(-1px) !important;
}
.swal2-cancel {
  background: #F7F3EB !important;
  border: 1px solid #ECE5D8 !important;
  color: #334E68 !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  padding: 10px 22px !important;
}
.swal2-cancel:hover {
  background: #ECE5D8 !important;
}
.swal2-icon { margin: 0 auto 18px !important; }

/* ── Native select chevron ────────────────────────────────── */
select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23627D98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px !important;
}

/* ── Sidebar scroll ───────────────────────────────────────── */
.sidebar-scroll { scrollbar-width: thin; scrollbar-color: #ECE5D8 transparent; }

/* ── Table responsive wrapper ─────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Page transition ──────────────────────────────────────── */
.page-enter { animation: fadeSlide .2s ease; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Focus ring ───────────────────────────────────────────── */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #B84A39 !important;
  box-shadow: 0 0 0 3px rgba(184, 74, 57, 0.15) !important;
}

/* ── Autofill: warm background ───────────────────────────── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset !important;
  -webkit-text-fill-color: #162C46 !important;
  transition: background-color 9999s ease-in-out 0s;
}

/* ── Touch: no tap highlight, no double-tap zoom ─────────── */
button, [role="button"], a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── Prevent iOS Safari auto-zoom on input focus ─────────── */
@media (max-width: 1023px) {
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
    line-height: 1.5;
  }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE SIDEBAR DRAWER
   ═══════════════════════════════════════════════════════════ */

/* Below lg (1024px): sidebar becomes a fixed off-canvas drawer */
@media (max-width: 1023px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: 288px;
    z-index: 50;
    transform: translateX(-110%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  }
  #sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 20px 0 60px rgba(15, 30, 48, .2);
  }
}

/* Overlay backdrop */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 48, .5);
  backdrop-filter: blur(2px);
  z-index: 45;
  animation: overlayIn .2s ease;
}
#sidebar-overlay.active { display: block; }
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Lock body scroll while drawer is open */
body.sidebar-open-body { overflow: hidden; }

/* ── Safe-area bottom padding (iOS notch) ─────────────────── */
.pb-safe {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
}

/* ── Brand utilities for Logo and Buttons ─────────────────── */
.bg-brand-gradient {
  background: linear-gradient(135deg, #B84A39 0%, #96392B 100%) !important;
}

.btn-brand-gradient {
  background: linear-gradient(135deg, #B84A39 0%, #96392B 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(184, 74, 57, 0.3) !important;
  transition: all 0.2s ease !important;
}

.btn-brand-gradient:hover {
  background: linear-gradient(135deg, #96392B 0%, #7B2E23 100%) !important;
  box-shadow: 0 6px 20px rgba(184, 74, 57, 0.4) !important;
  transform: translateY(-1px);
}

.btn-brand-gradient:active {
  transform: translateY(0);
}


