/* ==========================================================================
   SIRONA ERP - Modern Native Design System
   Sleek SaaS UI, Soft Shadows, Refined 1px Borders, Micro-interactions
   ========================================================================== */

:root {
  /* Palette */
  --sirona-bg: #F8FAFC;
  --sirona-surface: #FFFFFF;
  --sirona-text: #0F172A;
  --sirona-text-muted: #64748B;
  --sirona-text-light: #94A3B8;
  --sirona-border: #E2E8F0;
  --sirona-border-subtle: #F1F5F9;
  
  --sirona-orange: #F97316;
  --sirona-orange-hover: #EA580C;
  --sirona-orange-soft: #FFF7ED;
  --sirona-orange-border: #FED7AA;

  --sirona-blue: #3B82F6;
  --sirona-blue-hover: #2563EB;
  --sirona-blue-soft: #EFF6FF;
  --sirona-blue-border: #BFDBFE;
  
  --sirona-purple: #8B5CF6;
  --sirona-purple-hover: #7C3AED;
  --sirona-purple-soft: #F5F3FF;
  --sirona-purple-border: #DDD6FE;

  --sirona-emerald: #10B981;
  --sirona-emerald-hover: #059669;
  --sirona-emerald-soft: #ECFDF5;
  --sirona-emerald-border: #A7F3D0;

  --sirona-rose: #F43F5E;
  --sirona-rose-hover: #E11D48;
  --sirona-rose-soft: #FFF1F2;
  --sirona-rose-border: #FECDD3;

  --sirona-amber: #F59E0B;
  --sirona-amber-hover: #D97706;
  --sirona-amber-soft: #FFFBEB;
  --sirona-amber-border: #FDE68A;

  /* Shadows */
  --sirona-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --sirona-shadow-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.03);
  --sirona-shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --sirona-shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --sirona-shadow-modal: 0 25px 60px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.04);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Touch Targets */
  --touch-target-min: 44px;
  --bottom-nav-height: 64px;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 15px;
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

/* ==========================================================================
   GLOBAL APP SHELL - Unified Plus Jakarta Sans
   ========================================================================== */
body, button, input, select, textarea, .font-heading, .font-sans {
  font-family: var(--font-sans) !important;
}

body {
  min-height: 100%;
  background-color: var(--sirona-bg);
  color: var(--sirona-text);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Remove ambient blobs */
.ambient-mesh, .ambient-blob {
  display: none !important;
}

/* ==========================================================================
   MODERN FLAT CARDS - Sleek & Refined (No harsh 2px borders)
   ========================================================================== */
.neo-card, .sirona-card {
  background: var(--sirona-surface);
  border: 1px solid var(--sirona-border) !important;
  box-shadow: var(--sirona-shadow-sm) !important;
  border-radius: var(--radius-lg) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.neo-card:hover, .sirona-card:hover {
  border-color: #CBD5E1 !important;
  box-shadow: var(--sirona-shadow-md) !important;
}

.neo-card-subtle, .sirona-card-subtle {
  background: #F8FAFC;
  border: 1px solid var(--sirona-border) !important;
  box-shadow: var(--sirona-shadow-xs) !important;
  border-radius: var(--radius-md) !important;
}

/* ==========================================================================
   FLAT HEADER 
   ========================================================================== */
.neo-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0 !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
}

/* Content Wrapper Safe Bottom Padding (Prevents Floating Bottom Dock from obscuring content) */
.content-wrapper {
  padding-bottom: 7rem !important;
}
@media (min-width: 640px) {
  .content-wrapper {
    padding-bottom: 8.5rem !important;
  }
}

/* ==========================================================================
   IPHONE-STYLE FLOATING BOTTOM DOCK
   ========================================================================== */
.neo-bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  min-width: unset;
  max-width: calc(100vw - 32px);
  height: 58px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 9999px;
  border: 1.5px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.14), 0 4px 10px rgba(15, 23, 42, 0.05) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

@media (min-width: 640px) {
  .neo-bottom-nav {
    bottom: 24px;
    height: 58px;
    gap: 8px;
    padding: 0 14px;
    width: max-content;
    min-width: unset;
  }
}

.bottom-nav-item {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  text-decoration: none;
  border-radius: 50% !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
  border: 2px solid transparent;
}

.bottom-nav-item:hover {
  background: #FFF7ED;
  color: #EA580C;
  border-color: #FED7AA;
  border-radius: 50% !important;
  transform: translateY(-2px);
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

.bottom-nav-item.active {
  color: #FFFFFF !important;
  background: #2563EB !important;
  border-color: #1D4ED8 !important;
  border-radius: 50% !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
  transform: translateY(-2px);
}

.bottom-nav-item.active svg {
  stroke: #FFFFFF !important;
}

.nav-icon {
  width: 26px;
  height: 26px;
}

.content-wrapper {
  padding-bottom: calc(85px + env(safe-area-inset-bottom, 0px)) !important;
}

@media (max-width: 899px) {
  .content-wrapper {
    padding-bottom: calc(105px + env(safe-area-inset-bottom, 20px)) !important;
  }
}

/* ==========================================================================
   BUTTONS — Sleek Modern Native CSS
   ========================================================================== */
.touch-target {
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.neo-btn, .sirona-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: var(--radius-md) !important;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2px;
  cursor: pointer;
  border: 1px solid transparent !important;
  box-shadow: var(--sirona-shadow-xs) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  user-select: none;
  position: relative;
  white-space: nowrap;
}

.neo-btn:active, .sirona-btn:active {
  transform: scale(0.97) !important;
  box-shadow: none !important;
}

/* Primary — Vibrant Orange */
.neo-btn-primary, .sirona-btn-primary {
  background: var(--sirona-orange) !important;
  color: #FFFFFF !important;
  border-color: var(--sirona-orange-hover) !important;
}
.neo-btn-primary:hover, .sirona-btn-primary:hover {
  background: var(--sirona-orange-hover) !important;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25) !important;
}

/* Secondary — Vibrant Blue */
.neo-btn-secondary, .sirona-btn-secondary {
  background: var(--sirona-blue) !important;
  color: #FFFFFF !important;
  border-color: var(--sirona-blue-hover) !important;
}
.neo-btn-secondary:hover, .sirona-btn-secondary:hover {
  background: var(--sirona-blue-hover) !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25) !important;
}

/* Purple */
.sirona-btn-purple {
  background: var(--sirona-purple) !important;
  color: #FFFFFF !important;
  border-color: var(--sirona-purple-hover) !important;
}
.sirona-btn-purple:hover {
  background: var(--sirona-purple-hover) !important;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25) !important;
}

/* Rose / Red */
.sirona-btn-rose {
  background: var(--sirona-rose) !important;
  color: #FFFFFF !important;
  border-color: var(--sirona-rose-hover) !important;
}
.sirona-btn-rose:hover {
  background: var(--sirona-rose-hover) !important;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25) !important;
}

/* Outline / Soft */
.neo-btn-outline, .sirona-btn-outline {
  background: #FFFFFF !important;
  color: var(--sirona-text) !important;
  border-color: var(--sirona-border) !important;
}
.neo-btn-outline:hover, .sirona-btn-outline:hover {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
}

/* Emerald */
.neo-btn-emerald, .sirona-btn-emerald {
  background: var(--sirona-emerald) !important;
  color: #FFFFFF !important;
  border-color: var(--sirona-emerald-hover) !important;
}
.neo-btn-emerald:hover, .sirona-btn-emerald:hover {
  background: var(--sirona-emerald-hover) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
}

/* Small Detail Action Button */
.sirona-btn-detail {
  padding: 5px 12px !important;
  min-height: 28px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-radius: var(--radius-sm) !important;
  background: #F1F5F9 !important;
  color: var(--sirona-text) !important;
  border: 1px solid #E2E8F0 !important;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sirona-btn-detail:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
  transform: translateY(-1px);
}

/* ==========================================================================
   INPUTS & SELECTS — Sleek Modern Native CSS
   ========================================================================== */
.neo-input, .sirona-input, .sirona-select {
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  background: #FFFFFF;
  border: 1px solid var(--sirona-border);
  box-shadow: var(--sirona-shadow-xs) !important;
  border-radius: var(--radius-md) !important;
  font-size: 12px;
  font-weight: 600;
  color: var(--sirona-text);
  outline: none;
  transition: all 0.18s ease;
}

.neo-input:hover, .sirona-input:hover, .sirona-select:hover {
  border-color: #CBD5E1;
}

.neo-input:focus, .sirona-input:focus, .sirona-select:focus {
  background: #FFFFFF;
  border-color: var(--sirona-blue) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
}

select.neo-input, select.sirona-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 13px;
  padding-right: 32px;
}

select.neo-input option, select.sirona-select option {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
  font-weight: 600;
  font-size: 12px;
  padding: 8px 12px;
}

/* iOS WebKit Date & Month Input Overflow Reset */
input[type="date"], input[type="month"] {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="month"]::-webkit-date-and-time-value {
  text-align: left !important;
  min-height: 1.2em !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Desktop & Mobile 1-Row Filter Helpers */
.neo-filter-row, .sirona-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Top Header Filters & Action Bar (Desktop 1-Line, Mobile Clean Row) */
.sirona-header-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sirona-header-filters form {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 1023px) {
  .sirona-header-filters {
    width: 100% !important;
  }
  .sirona-header-filters form {
    width: 100% !important;
  }
}

@media (min-width: 1024px) {
  .sirona-header-filters {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    width: auto !important;
    flex-shrink: 0 !important;
  }
  .sirona-header-filters form {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
    flex-shrink: 0 !important;
  }
  .sirona-header-filters input[type="month"],
  .sirona-header-filters input[type="date"],
  .sirona-header-filters .sirona-input {
    width: 145px !important;
    min-width: 135px !important;
    max-width: 155px !important;
    flex-shrink: 0 !important;
  }
  .sirona-header-filters select,
  .sirona-header-filters .sirona-select {
    width: auto !important;
    min-width: 140px !important;
    max-width: 220px !important;
    flex-shrink: 0 !important;
  }
  .sirona-header-filters .sirona-btn,
  .sirona-header-filters button {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 639px) {
  .sirona-filter-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  .sirona-filter-grid-3 .sirona-input,
  .sirona-filter-grid-3 .sirona-select,
  .sirona-filter-grid-3 input,
  .sirona-filter-grid-3 select {
    height: 34px !important;
    font-size: 11px !important;
    padding: 0 8px !important;
    border-radius: 8px !important;
  }
}

/* ==========================================================================
   BADGES & PILLS — Modern SaaS Style
   ========================================================================== */
.sirona-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.sirona-pill-purple {
  background: var(--sirona-purple-soft);
  color: var(--sirona-purple-hover);
  border: 1px solid var(--sirona-purple-border);
}

.sirona-pill-rose {
  background: var(--sirona-rose-soft);
  color: var(--sirona-rose-hover);
  border: 1px solid var(--sirona-rose-border);
}

.sirona-pill-emerald {
  background: var(--sirona-emerald-soft);
  color: var(--sirona-emerald-hover);
  border: 1px solid var(--sirona-emerald-border);
}

.sirona-pill-blue {
  background: var(--sirona-blue-soft);
  color: var(--sirona-blue-hover);
  border: 1px solid var(--sirona-blue-border);
}

.sirona-pill-amber {
  background: var(--sirona-amber-soft);
  color: var(--sirona-amber-hover);
  border: 1px solid var(--sirona-amber-border);
}

.sirona-pill-slate {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
}

/* ==========================================================================
   TABLES — Sleek Modern Clean UI
   ========================================================================== */
.sirona-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.sirona-table thead th {
  background: #F8FAFC;
  color: #64748B;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--sirona-border);
  white-space: nowrap;
}

.sirona-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--sirona-border-subtle);
  color: var(--sirona-text);
  font-weight: 500;
  vertical-align: middle;
}

.sirona-table tbody tr {
  transition: background-color 0.15s ease;
}

.sirona-table tbody tr:hover {
  background-color: #F8FAFC;
}

.sirona-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   CUSTOM SCROLLBAR — Flat
   ========================================================================== */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #FFFFFF;
  border-left: 2px solid var(--sirona-border);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--sirona-border);
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--sirona-orange);
}

/* ==========================================================================
   PAGE TRANSITIONS
   ========================================================================== */
@keyframes pageFadeIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.page-transition {
  animation: pageFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: opacity, transform;
}

.page-exit {
  animation: pageFadeOut 0.15s cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}

/* ==========================================================================
   LAYOUT CONTENT WRAPPER
   ========================================================================== */
.content-wrapper {
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 16px) !important;
  min-height: calc(100vh - 60px);
  position: relative;
  z-index: 1;
}

@media (min-width: 900px) {
  .content-wrapper {
    padding-bottom: 84px !important;
  }
}

/* ==========================================================================
   GLOBAL MODAL VIEWPORT CENTERING
   Ensures ALL modals/popups render centered on the actual browser viewport,
   even when parent elements have transforms (will-change, animation) that
   would normally trap position:fixed elements.
   ========================================================================== */
.neo-modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  margin: 0 !important;
  padding: 16px !important;
  overflow-y: auto !important;
}

/* When hidden, MUST be hidden completely and ignore all clicks */
.neo-modal-backdrop.hidden,
.neo-modal-backdrop[hidden],
[id^="modal"].hidden,
[id^="Modal"].hidden,
#detailModal.hidden,
#modalDetailComplaint.hidden,
#modalProof.hidden,
#modalQrCode.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* Only when active and NOT hidden: display flex centered */
.neo-modal-backdrop:not(.hidden) {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
}

.neo-modal-box,
.neo-modal-backdrop > div {
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
  position: relative;
  pointer-events: auto !important;
}

/* ==========================================================================
   SIRONA MODERN MODAL SYSTEM
   ========================================================================== */
.sirona-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100% !important;
  height: 100dvh !important;
  min-height: -webkit-fill-available !important;
  z-index: 999999 !important;
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 16px 12px 140px 12px !important;
  margin: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

.sirona-modal-backdrop.hidden,
.sirona-modal-backdrop[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.sirona-modal-card {
  background: #FFFFFF !important;
  border-radius: 20px !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.05) !important;
  max-width: 520px;
  width: 100%;
  height: auto !important;
  max-height: none !important;
  display: flex;
  flex-direction: column;
  overflow: visible !important;
  position: relative;
  animation: sironaModalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 12px auto !important;
}

@keyframes sironaModalPop {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.sirona-modal-header {
  padding: 16px 20px !important;
  border-bottom: 1px solid #F1F5F9 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: #FFFFFF !important;
  border-top-left-radius: 20px !important;
  border-top-right-radius: 20px !important;
  flex-shrink: 0;
}

.sirona-modal-header h3 {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #0F172A !important;
  letter-spacing: -0.2px;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.sirona-modal-close {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #F1F5F9 !important;
  border: none !important;
  color: #64748B !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  line-height: 1 !important;
}

.sirona-modal-close:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
  transform: rotate(90deg);
}

.sirona-modal-body {
  padding: 20px !important;
  height: auto !important;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sirona-modal-footer {
  padding: 16px 20px !important;
  border-top: 1px solid #F1F5F9 !important;
  background: #F8FAFC !important;
  border-bottom-left-radius: 20px !important;
  border-bottom-right-radius: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex-shrink: 0;
}

/* Sirona Data Tiles inside Modals */
.sirona-tile {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 14px;
}

.sirona-tile-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748B;
  margin-bottom: 4px;
  display: block;
}

.sirona-tile-value {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
}

/* Lock body scroll only when modal is actively visible */
body.modal-open {
  overflow: hidden !important;
}

/* ==========================================================================
   PER-ELEMENT & NETWORK LOADING ANIMATIONS (Anti-Stuck & Slow Network)
   ========================================================================== */

/* Top Loading Progress Bar */
#neoProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: #F97316;
  z-index: 99999;
  transition: width 0.25s ease-out, opacity 0.3s ease;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(249, 115, 22, 0.4);
}

#neoProgressBar.indeterminate {
  width: 40% !important;
  animation: neo-progress-bar-indet 1.2s infinite ease-in-out;
}

@keyframes neo-progress-bar-indet {
  0% { left: 0%; width: 25%; }
  50% { left: 40%; width: 50%; }
  100% { left: 100%; width: 25%; }
}

/* Button & Element Loading State */
.is-loading,
button.is-loading,
a.is-loading {
  position: relative !important;
  pointer-events: none !important;
  opacity: 0.82 !important;
  cursor: wait !important;
}

.btn-loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2.5px solid currentColor;
  border-top-color: transparent !important;
  border-radius: 50%;
  animation: neo-spin 0.65s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

@keyframes neo-spin {
  to { transform: rotate(360deg); }
}

/* Element Loading Pulse (Indicates clicked card/row is working) */
.element-loading-pulse {
  animation: neo-pulse 1s infinite alternate ease-in-out !important;
  border-color: #F97316 !important;
  box-shadow: 3px 3px 0px #F97316 !important;
}

@keyframes neo-pulse {
  from {
    background-color: rgba(254, 240, 138, 0.25);
    opacity: 0.9;
  }
  to {
    background-color: rgba(254, 240, 138, 0.7);
    opacity: 1;
  }
}

/* Slow Network Floating Notice Toast - Centered on screen */
#neoSlowNetworkToast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  background: #FFFFFF;
  border: 2px solid #F97316;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: #0F172A;
  pointer-events: auto;
  border-radius: 16px;
  max-width: 90vw;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   GLOBAL COMPACT & RESPONSIVE CALENDAR / DATE & MONTH INPUTS
   Mencegah kalender/datepicker keluar batas layar / overflow di HP mobile
   ========================================================================== */
input[type="date"],
input[type="month"] {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Sederhanakan ikon picker bawaan webkit browser agar pas dan tidak meluber */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  padding: 0;
  margin: 0 0 0 4px;
  width: 16px;
  height: 16px;
  transition: opacity 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* iOS Safari & WebKit reset alignment */
input[type="date"]::-webkit-date-and-time-value,
input[type="month"]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
  padding: 0;
  min-height: 1.2em;
}

/* Standard Sirona Input & Select styling */
.sirona-input,
.sirona-select {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  height: 38px;
  padding: 0 10px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #1E293B;
  transition: all 0.2s ease;
}

.sirona-input:focus,
.sirona-select:focus {
  border-color: #2563EB;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Mobile Screen Enhancements (< 640px) */
@media (max-width: 639px) {
  input[type="date"],
  input[type="month"] {
    height: 36px !important;
    font-size: 11px !important;
    padding-left: 8px !important;
    padding-right: 6px !important;
    border-radius: 10px !important;
    letter-spacing: -0.2px;
  }

  input[type="date"]::-webkit-calendar-picker-indicator,
  input[type="month"]::-webkit-calendar-picker-indicator {
    width: 13px !important;
    height: 13px !important;
  }

  .sirona-input,
  .sirona-select {
    height: 34px !important;
    font-size: 11px !important;
    padding: 0 8px !important;
    border-radius: 8px !important;
  }
}

/* ==========================================================================
   TABLET 8.7" RANGE (540px - 700px) — Mid-Breakpoint Responsive Tweaks
   Targets tablets like Xiaomi Pad Mini, Samsung Tab A7 Lite, Lenovo Tab M8
   ========================================================================== */

/* Tablet landscape phones and portrait small tablets */
@media (min-width: 480px) and (max-width: 700px) {
  /* Ensure grid cards wrap properly on narrow tablets */
  .grid.grid-cols-2 {
    gap: 10px !important;
  }

  /* Keep date/month inputs readable on tablet */
  input[type="date"],
  input[type="month"] {
    font-size: 12px !important;
    height: 40px !important;
    min-width: 0 !important;
  }

  /* Bottom nav: slightly larger touch targets on tablets */
  .bottom-nav-item {
    width: 46px !important;
    height: 46px !important;
  }

  /* Ensure modal content scrolls on small tablets */
  .neo-modal-backdrop > div,
  [id^="modal"] > div {
    max-height: 88vh !important;
    overflow-y: auto !important;
  }
}

/* ==========================================================================
   GLOBAL OVERFLOW GUARD — Prevent horizontal scroll on all viewports
   (Kecuali header/navbar agar floating dropdown profil bisa melayang bebas ke luar)
   ========================================================================== */
main, .content-wrapper {
  overflow-x: hidden;
  max-width: 100%;
}

.neo-header,
.neo-header .max-w-7xl,
header,
header .max-w-7xl,
#topAccountMenuWrapper {
  overflow: visible !important;
}

/* Tables are exempt — they need horizontal scroll */
.overflow-x-auto {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   ANTISLOP — Clean Typography & Spacing Improvements
   Prevents UI from looking generic/default
   ========================================================================== */

/* Prevent double-borders on nested Tailwind border-2 elements */
.border-2.border-slate-200 > .border-2.border-slate-200 {
  border-width: 1px !important;
}

/* Ensure all interactive elements have proper cursor */
button, [type="button"], [type="submit"], [type="reset"],
a[href], label[for], select, input[type="checkbox"], input[type="radio"] {
  cursor: pointer;
}

/* Touch-friendly minimum tap target for all buttons and links in nav */
nav a, nav button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

/* Smooth scroll for all anchor navigation */
html {
  scroll-behavior: smooth;
}

/* Prevent layout shift on font load */
body {
  font-display: swap;
}

/* ==========================================================================
   PRINT — Force show empty Rekap Mutasi & Selisih Opname sections
   Ensures PDF report always shows these sections even with zero data
   ========================================================================== */
@media print {
  /* Force all collapsible report sections to be visible in print */
  #secTransfersRecap,
  #secOpnameRecap,
  #secSalesRecap,
  #secPayrollRecap {
    display: block !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 12px !important;
  }

  /* Ensure toggle buttons are hidden in print */
  button[onclick*="toggleColumn"] {
    display: none !important;
  }

  /* Prevent page breaks inside report sections */
  .bg-white.rounded-2xl {
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   RESPONSIVE SUMMARY CARDS — Ensure stat cards wrap cleanly on mobile
   ========================================================================== */
@media (max-width: 480px) {
  /* On very small phones, stack filter columns */
  .grid.grid-cols-2.gap-2 {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  /* Table cells: prevent extreme overflow */
  table td, table th {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Card action buttons: ensure they're tap-friendly */
  .grid.grid-cols-2.gap-2 button {
    min-height: 38px;
    font-size: 11px !important;
  }
}

/* ==========================================================================
   BOTTOM SAFE AREA CLEARANCE FOR FLOATING NAV
   ========================================================================== */
.content-wrapper,
#mainContent {
  scroll-padding-bottom: 130px !important;
}
