/* ===========================
   Custom Primary Color #6C5CE7
   POS Pakaian - Custom Styles
   =========================== */

:root {
  --bs-primary: #6C5CE7;
  --bs-primary-rgb: 108, 92, 231;
  --bs-primary-hover: #5b4dc4;
  --bs-primary-light: rgba(108, 92, 231, 0.12);
}

/* === Buttons === */
.btn-primary {
  background-color: #6C5CE7 !important;
  border-color: #6C5CE7 !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-check:checked+.btn-primary {
  background-color: #5b4dc4 !important;
  border-color: #5b4dc4 !important;
}

.btn-outline-primary {
  color: #6C5CE7 !important;
  border-color: #6C5CE7 !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: #6C5CE7 !important;
  border-color: #6C5CE7 !important;
  color: #fff !important;
}

/* === Background === */
.bg-primary {
  background-color: #6C5CE7 !important;
}

.bg-label-primary {
  background-color: rgba(108, 92, 231, 0.12) !important;
  color: #6C5CE7 !important;
}

/* === Text === */
.text-primary {
  color: #6C5CE7 !important;
}

a.text-primary:hover,
a.text-primary:focus {
  color: #5b4dc4 !important;
}

/* === Menu & Sidebar === */
.menu-link.active {
  background-color: rgba(108, 92, 231, 0.08) !important;
  color: #6C5CE7 !important;
}

.menu-link.active::before {
  background: #6C5CE7 !important;
}

.layout-menu .menu-link:hover:not(.active) {
  background-color: rgba(108, 92, 231, 0.04) !important;
}

.menu-sub .menu-link.active {
  color: #6C5CE7 !important;
}

/* === Badges === */
.badge.bg-primary {
  background-color: #6C5CE7 !important;
}

.badge.bg-label-primary {
  background-color: rgba(108, 92, 231, 0.12) !important;
  color: #6C5CE7 !important;
}

/* === Form Controls === */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #6C5CE7 !important;
  box-shadow: 0 0 0 0.25rem rgba(108, 92, 231, 0.25) !important;
}

.form-check-input:checked {
  background-color: #6C5CE7 !important;
  border-color: #6C5CE7 !important;
}

/* === Pagination === */
.pagination .page-link {
  color: #6C5CE7 !important;
}

.pagination .page-item.active .page-link {
  background-color: #6C5CE7 !important;
  border-color: #6C5CE7 !important;
  color: #fff !important;
}

.pagination .page-link:hover {
  background-color: rgba(108, 92, 231, 0.08) !important;
  color: #6C5CE7 !important;
}

/* === Progress Bar === */
.progress-bar {
  background-color: #6C5CE7 !important;
}

/* === Alerts === */
.alert-primary {
  background-color: rgba(108, 92, 231, 0.12) !important;
  border-color: rgba(108, 92, 231, 0.3) !important;
  color: #6C5CE7 !important;
}

/* === Dropdown === */
.dropdown-item.active,
.dropdown-item:active {
  background-color: #6C5CE7 !important;
}

/* === Nav Tabs === */
.nav-tabs .nav-link.active {
  color: #6C5CE7 !important;
  border-bottom-color: #6C5CE7 !important;
}

.nav-pills .nav-link.active {
  background-color: #6C5CE7 !important;
}

/* === Links === */
a {
  color: #6C5CE7;
}

a:hover {
  color: #5b4dc4;
}

/* === Switches/Toggle === */
.form-switch .form-check-input:checked {
  background-color: #6C5CE7 !important;
  border-color: #6C5CE7 !important;
}

/* === Tables === */
.table-primary {
  background-color: rgba(108, 92, 231, 0.12) !important;
}

/* === Cards === */
.card-primary {
  border-color: #6C5CE7 !important;
}

.card-primary .card-header {
  background-color: #6C5CE7 !important;
  color: #fff !important;
}

/* === Custom Utilities === */
.border-primary {
  border-color: #6C5CE7 !important;
}

.border-top-primary {
  border-top-color: #6C5CE7 !important;
}

.border-bottom-primary {
  border-bottom-color: #6C5CE7 !important;
}

.border-start-primary {
  border-left-color: #6C5CE7 !important;
}

.border-end-primary {
  border-right-color: #6C5CE7 !important;
}

/* === Shadows === */
.shadow-primary {
  box-shadow: 0 0.125rem 0.25rem rgba(108, 92, 231, 0.2) !important;
}

.shadow-primary-lg {
  box-shadow: 0 0.5rem 1rem rgba(108, 92, 231, 0.15) !important;
}

/* === Microinteractions === */
.content-wrapper {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  92% {
    transform: translateX(5px);
  }
}

.shake-error {
  animation: shake 0.5s ease-in-out;
}

.btn {
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.btn-pos-system {
  background: linear-gradient(135deg, #6C5CE7 0%, #5b4dc4 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
  transition: all 0.3s ease;
}

.btn-pos-system:hover {
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.5);
  transform: translateY(-2px);
}

.notification-badge {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

* {
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* =========================================
   Global Delete Confirmation Modal Styles
   ========================================= */

.swal-icon-container {
  width: 65px;
  height: 65px;
  background-color: #fff;
  border: 3px solid #FF4724;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  box-shadow: 0 10px 25px rgba(255, 71, 36, 0.15);
}

.swal-icon-text {
  font-size: 38px;
  color: #FF4724;
  font-weight: 600;
  line-height: 1;
  font-family: 'Public Sans', sans-serif;
}

.btn-swal-cancel {
  background-color: #fff;
  color: #8A99AF;
  border: 1.5px solid #D1D5DB;
  padding: 12px 40px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  min-width: 140px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-swal-cancel:hover {
  background-color: #F8FAFC;
  border-color: #94A3B8;
  color: #475569;
  transform: translateY(-1px);
}

.btn-swal-confirm {
  background-color: #FF4724;
  color: #fff;
  border: none;
  padding: 12px 40px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  min-width: 140px;
  box-shadow: 0 8px 20px rgba(255, 71, 36, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-swal-confirm:hover {
  background-color: #E63E1C;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(255, 71, 36, 0.45);
}

.btn-swal-confirm:active {
  transform: translateY(0);
}

.delete-modal-content {
  border-radius: 20px !important;
  border: none !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

.delete-modal-title {
  color: #32475C;
  font-size: 22px;
  font-family: 'Public Sans', sans-serif;
  font-weight: bold;
}

.delete-modal-text {
  color: #697a8d;
  font-size: 16px;
  line-height: 1.5;
  opacity: 0.8;
}

/* Laravel Notify Style Fixes */
.notify,
.notify-container,
#notify-container {
  z-index: 100000 !important;
}

/* === SweetAlert2 Custom Toast Design === */

/* High Z-Index to overlap Navbar & Spacing to be below Header */
div:where(.swal2-container).notify-container-fix {
  z-index: 109000 !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  /* FIX: cegah container stretch ke kiri */
  bottom: auto !important;
  width: auto !important;
  /* FIX: lebar container ikut konten */
  padding: 0 !important;
}

/* Base Popup Reset */
.custom-toast-popup {
  padding: 10px !important;
  background: transparent !important;
  box-shadow: none !important;
  width: 400px !important;
  max-width: 90vw !important;
  overflow: visible !important;
  border-radius: 0 !important;
  /* FIX: hapus radius bawaan SweetAlert2 */
}

/* FIX: Sembunyikan elemen default SweetAlert2 yang ganggu layout */
.notify-container-fix .swal2-icon,
.notify-container-fix .swal2-title,
.notify-container-fix .swal2-actions,
.notify-container-fix .swal2-footer,
.notify-container-fix .swal2-close {
  display: none !important;
}

.notify-container-fix .swal2-html-container {
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* The actual Card */
.custom-toast-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: flex-start;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  /* FIX: clip pseudo-element border kiri */
  font-family: 'Public Sans', sans-serif;
}

/* FIX: Ganti border-left biasa dengan ::before agar tidak terpotong padding */
.custom-toast-content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: #10b981;
  /* default warna */
  border-radius: 12px 0 0 12px;
}

/* Variant Colors */
.custom-toast-success .custom-toast-content::before {
  background: #10b981;
}

.custom-toast-error .custom-toast-content::before {
  background: #ef4444;
}

.custom-toast-warning .custom-toast-content::before {
  background: #f59e0b;
}

.custom-toast-info .custom-toast-content::before {
  background: #3b82f6;
}

/* Icon Container */
.custom-toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  /* FIX: beri jarak dari border kiri ::before */
  margin-right: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.custom-toast-success .custom-toast-icon {
  background-color: #10b981;
  color: white;
}

.custom-toast-error .custom-toast-icon {
  background-color: #ef4444;
  color: white;
}

.custom-toast-warning .custom-toast-icon {
  background-color: #f59e0b;
  color: white;
}

.custom-toast-info .custom-toast-icon {
  background-color: #3b82f6;
  color: white;
}

.custom-toast-icon i {
  font-size: 16px;
  font-weight: bold;
}

/* Text Body */
.custom-toast-body {
  flex-grow: 1;
  text-align: left;
  padding-right: 10px;
}

.custom-toast-title {
  font-weight: 700;
  font-size: 15px;
  color: #1f2937;
  margin-bottom: 2px;
  line-height: 1.3;
}

.custom-toast-message {
  font-size: 13.5px;
  color: #6b7280;
  line-height: 1.4;
}

/* Close Button */
.custom-toast-close {
  cursor: pointer;
  color: #9ca3af;
  font-size: 20px;
  line-height: 1;
  transition: color 0.2s;
  margin-top: 0px;
  background: none;
  /* FIX: reset style tombol bawaan browser */
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.custom-toast-close:hover {
  color: #4b5563;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .custom-toast-popup {
    width: 90% !important;
    margin: 0 auto 20px auto !important;
  }
}

/* =========================================
   Custom Modal Close Button (Offset Look)
   ========================================= */
.modal .modal-header .btn-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5' stroke='%238592A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-size: 14px !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  opacity: 1 !important;
  z-index: 1070;
  margin: 0 !important;
  transition: all 0.2s ease-in-out;
  transform: none !important;
}

.modal .modal-header .btn-close::before,
.modal .modal-header .btn-close::after {
  content: none !important;
  display: none !important;
}

.modal .modal-header .btn-close:hover {
  transform: scale(1.1) !important;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5' stroke='%23566a7f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15) !important;
}

/* Pengecualian untuk Detail Modal yang memiliki header berwarna */
.modal .modal-header .btn-close.btn-close-white {
  top: 15px !important;
  right: 15px !important;
  background-color: rgba(255, 255, 255, 0.15) !important;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  box-shadow: none !important;
}

.modal .modal-header .btn-close.btn-close-white:hover {
  background-color: rgba(255, 255, 255, 0.25) !important;
}

@media (max-width: 576px) {
  .modal .modal-header .btn-close {
    top: 5px;
    right: 5px;
    box-shadow: none !important;
  }
}

/* =========================================
   Sidebar Collapse — Icon-only Mini Mode
   ========================================= */

/* Tombol toggle di sidebar header */
#sidebar-collapse-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: #697a8d;
    transition: all 0.2s ease;
    opacity: 0.7;
}

#sidebar-collapse-btn:hover {
    background-color: rgba(108, 92, 231, 0.08);
    color: #6C5CE7;
    opacity: 1;
}

#sidebar-toggle-icon {
    transition: transform 0.3s ease;
}

/* Smooth width transition untuk sidebar dan layout */
.layout-menu,
.layout-page,
.layout-navbar {
    transition: width 0.3s ease, margin-left 0.3s ease, padding-left 0.3s ease !important;
}

/* Sembunyikan teks menu saat collapsed — dihandle Sneat, tambah ini untuk header section */
.layout-menu-collapsed .layout-menu .menu-header-text {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Tooltip override untuk sidebar — posisi lebih baik */
.layout-menu .tooltip-inner {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    background-color: #2c3e50;
}

/* Pastikan icon toggle tidak hilang saat collapsed */
.layout-menu-collapsed #sidebar-collapse-btn {
    opacity: 1;
}