/* Shadcn Scroll Area */
.shadcn-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.shadcn-scroll::-webkit-scrollbar-track { background: transparent; }
.shadcn-scroll::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }
.shadcn-scroll::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; }
[data-theme="dark"] .shadcn-scroll::-webkit-scrollbar-thumb { background-color: #475569; }
[data-theme="dark"] .shadcn-scroll::-webkit-scrollbar-thumb:hover { background-color: #64748b; }

/* Shadcn Date Picker */
.custom-shadcn-date::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; position: absolute; width: 100%; height: 100%; left: 0; top: 0; }
.flatpickr-calendar { font-family: inherit !important; border: 1px solid #e2e8f0 !important; border-radius: 0.75rem !important; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) !important; padding: 0.5rem !important; width: auto !important; z-index: 99999 !important; }
.flatpickr-day { border-radius: 0.375rem !important; color: #0F0F0F !important; margin: 2px !important; }
.flatpickr-day:hover, .flatpickr-day.prevMonthDay:hover, .flatpickr-day.nextMonthDay:hover { background: #f1f5f9 !important; border-color: #f1f5f9 !important; color: #0F0F0F !important; }
.flatpickr-day.selected { background: #16a34a !important; border-color: #16a34a !important; color: white !important; }
.flatpickr-months .flatpickr-month { color: #0F0F0F !important; fill: #0F0F0F !important; }
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 600 !important; }
.flatpickr-weekday { color: #64748b !important; font-weight: 600 !important; font-size: 0.75rem !important; }
[data-theme="dark"] .flatpickr-calendar { background: #0F0F0F !important; border-color: #1E1E1E !important; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.5) !important; }
[data-theme="dark"] .flatpickr-day { color: #f8fafc !important; }
[data-theme="dark"] .flatpickr-day:hover { background: #1E1E1E !important; border-color: #1E1E1E !important; }
[data-theme="dark"] .flatpickr-day.selected { background: #16a34a !important; border-color: #16a34a !important; }
[data-theme="dark"] .flatpickr-months .flatpickr-month { color: #f8fafc !important; fill: #f8fafc !important; }
[data-theme="dark"] .flatpickr-weekday { color: #94a3b8 !important; }

/* Shadcn / REUI Alert Toasts */
#custom-alert-container { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 100000; display: flex; flex-direction: column; gap: 0.75rem; max-width: 420px; width: calc(100% - 2.5rem); pointer-events: none; }
.shadcn-alert { pointer-events: auto; position: relative; width: 100%; border-radius: 0.75rem; border: 1px solid #e2e8f0; padding: 1rem 2.25rem 1rem 3.25rem; background-color: #ffffff; color: #0F0F0F; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; transition: opacity 0.3s ease-out, transform 0.3s ease-out; font-family: inherit; overflow: hidden; display: flex; align-items: flex-start; }
.shadcn-alert.hiding { opacity: 0; transform: translateX(30px); }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px) scale(0.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
.shadcn-alert svg { position: absolute; left: 1.1rem; top: 1.15rem; height: 1.35rem; width: 1.35rem; }
.shadcn-alert-title { margin-top: 0; margin-bottom: 0.25rem; font-weight: 700; font-size: 0.875rem; line-height: 1.2; letter-spacing: -0.01em; }
.shadcn-alert-desc { font-size: 0.8125rem; line-height: 1.5; opacity: 0.9; word-break: break-word; }
.shadcn-alert-close { position: absolute; top: 0.5rem; right: 0.5rem; background: transparent; border: none; font-size: 1.25rem; line-height: 1; color: #94a3b8; cursor: pointer; padding: 0.25rem 0.5rem; border-radius: 0.375rem; transition: color 0.15s, background-color 0.15s; }
.shadcn-alert-close:hover { color: #0F0F0F; background-color: rgba(0,0,0,0.05); }
.shadcn-alert-progress { position: absolute; bottom: 0; left: 0; height: 3px; width: 100%; background: currentColor; opacity: 0.3; animation: toastProgress 5s linear forwards; }
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }
.text-success { color: #22c55e !important; }
.text-warning { color: #f59e0b !important; }
.text-destructive { color: #ef4444 !important; }
.shadcn-alert-success { border-color: #22c55e; color: #166534; background-color: #f0fdf4; }
.shadcn-alert-success svg { color: #22c55e; }
.shadcn-alert-warning { border-color: #f59e0b; color: #b45309; background-color: #fffbeb; }
.shadcn-alert-warning svg { color: #f59e0b; }
.shadcn-alert-destructive { border-color: #ef4444; color: #991b1b; background-color: #fef2f2; }
.shadcn-alert-destructive svg { color: #ef4444; }
.shadcn-alert-invert { border-color: #1E1E1E; color: #f8fafc; background-color: #0F0F0F; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3); }
.shadcn-alert-invert .shadcn-alert-title { color: #ffffff; }
.shadcn-alert-invert .shadcn-alert-desc { color: #cbd5e1; }
.shadcn-alert-invert svg { color: #22c55e; }
.shadcn-alert-invert .shadcn-alert-close { color: #64748b; }
.shadcn-alert-invert .shadcn-alert-close:hover { color: #ffffff; background-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .text-success { color: #4ade80 !important; }
[data-theme="dark"] .shadcn-alert { background-color: #020817; color: #f8fafc; }
[data-theme="dark"] .shadcn-alert-success { border-color: #22c55e; color: #4ade80; background-color: rgba(34,197,94,0.1); }
[data-theme="dark"] .shadcn-alert-warning { border-color: #f59e0b; color: #fbbf24; background-color: rgba(245,158,11,0.1); }
[data-theme="dark"] .shadcn-alert-destructive { border-color: #ef4444; color: #f87171; background-color: rgba(239,68,68,0.1); }
[data-theme="dark"] .shadcn-alert-invert { border-color: #333333; color: #f8fafc; background-color: #020817; }
[data-theme="dark"] .shadcn-alert-invert svg { color: #4ade80; }

/* Override login card overflow for custom select */
.card { overflow: visible !important; }
.card::before { border-top-left-radius: 12px; border-top-right-radius: 12px; }

/* Shadcn Alert Dialog (Confirm) */
#shadcn-dialog-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  animation: dialogFadeIn 0.2s ease-out;
  transition: opacity 0.2s;
}
#shadcn-dialog-overlay.hiding { opacity: 0; }

#shadcn-dialog-content {
  position: fixed; left: 50%; top: 50%; z-index: 100000;
  width: 90%; max-width: 450px;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  animation: dialogZoomIn 0.2s ease-out;
  transition: opacity 0.2s, transform 0.2s;
  font-family: inherit;
}
#shadcn-dialog-content.hiding { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }

@keyframes dialogFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes dialogZoomIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

[data-theme="dark"] #shadcn-dialog-content {
  background-color: #020817;
  border: 1px solid #1E1E1E;
  color: #f8fafc;
}

