/* ==========================================
   DESIGN TOKENS & SYSTEM VARIABLES
   ========================================== */
:root {
  color-scheme: dark;
  /* Color Palette (HSL Tailored) */
  --bg-primary: #090d16;
  --bg-secondary: #0f1626;
  --bg-glass: rgba(15, 22, 38, 0.65);
  --bg-glass-hover: rgba(22, 32, 56, 0.75);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-glow: rgba(99, 102, 241, 0.3);

  --color-primary: #6366f1;
  /* Electric Indigo */
  --color-primary-glow: rgba(99, 102, 241, 0.15);
  --color-secondary: #06b6d4;
  /* Neon Cyan */
  --color-accent: #a855f7;
  /* Royal Purple */

  --color-success: #10b981;
  /* Mint Green */
  --color-warning: #f59e0b;
  /* Amber */
  --color-danger: #ef4444;
  /* Rose Red */
  --color-info: #3b82f6;
  /* Ocean Blue */

  --text-primary: #f8fafc;
  /* Slate 50 */
  --text-secondary: #94a3b8;
  /* Slate 400 */
  --text-muted: #64748b;
  /* Slate 500 */
  --text-link: #06b6d4;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Layout & Spacing */
  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.25);
}

/* ==========================================
   CORE RESET & TYPOGRAPHY
   ========================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Remove number arrows globally */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5em;
  line-height: 1.2;
}

/* Custom Scrollbars (Ultra-thin 4px) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  border: none;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ==========================================
   LAYOUT STRUCTURE
   ========================================== */
.erp-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.erp-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-right: 1px solid var(--border-glass);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 100;
  transition: var(--transition-smooth);
  box-sizing: border-box;
  overflow: hidden;
}

.erp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 0 8px;
  flex-shrink: 0;
}

.erp-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.erp-brand-logo:hover {
  transform: scale(1.05) rotate(-3deg);
  box-shadow: 0 6px 25px rgba(239, 68, 68, 0.65), inset 0 1px 3px rgba(255, 255, 255, 0.6);
}

.erp-brand-logo span {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 900;
  color: #fff;
  font-size: 20px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.erp-brand-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 60%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.erp-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

/* Custom Scrollbar for sidebar menu */
.erp-menu::-webkit-scrollbar {
  width: 4px;
}

.erp-menu::-webkit-scrollbar-track {
  background: transparent;
}

.erp-menu::-webkit-scrollbar-thumb {
  background: var(--bg-glass-hover);
  border-radius: 4px;
}

.erp-menu::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.erp-menu-item>a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition-smooth);
}

.erp-menu-item>a:hover,
.erp-menu-item.active>a {
  color: var(--text-primary);
  background: var(--color-primary-glow);
  border-left: 3px solid var(--color-primary);
  box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.05);
}

.erp-submenu {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-top: 10px;
  margin-bottom: 4px;
}

.erp-submenu-item>a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 5px 14px 5px 46px;
  color: var(--text-secondary);
  font-weight: 400;
  transition: var(--transition-smooth);
  font-size: 0.9em;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.erp-submenu-item>a::before {
  content: '';
  position: absolute;
  left: 26px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition-smooth);
}

.erp-submenu-item>a:hover,
.erp-submenu-item.active>a {
  color: var(--text-primary) !important;
  transform: translateX(4px);
}

.erp-submenu-item>a:hover::before,
.erp-submenu-item.active>a::before {
  background: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
  transform: scale(1.5);
}

/* Prevent parent active state bleeding into all submenu items when they are not active themselves */
.erp-menu-item.active .erp-submenu-item:not(.active)>a {
  color: var(--text-secondary) !important;
}

.erp-menu-item.active .erp-submenu-item>a:hover {
  color: var(--text-primary) !important;
}

.erp-menu-item>a svg {
  width: 20px;
  height: 20px;
  transition: var(--transition-smooth);
}

.erp-menu-item>a:hover svg,
.erp-menu-item.active>a svg {
  transform: scale(1.1);
  color: var(--color-secondary);
}

.erp-sidebar-footer {
  margin-top: auto;
  padding: 16px;
  padding-bottom: max(16px, calc(16px + env(safe-area-inset-bottom, 0px)));
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.erp-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-secondary);
  background-color: #3b82f6;
  background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.erp-user-info {
  display: flex;
  flex-direction: column;
}

.erp-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.erp-user-role {
  font-size: 12px;
  color: var(--text-muted);
}

.erp-logout-btn {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition-fast);
  flex-shrink: 0;
  margin-left: 8px;
}

.erp-logout-btn:hover {
  color: var(--color-danger) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.08) !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15) !important;
  text-shadow: none !important;
}

/* Main Viewport Content */
.erp-main {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  min-width: 0;
  /* Prevents overflow issues */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 70px;
  /* Space for fixed footer */
}

/* Header Styling */
.erp-header {
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.erp-search-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  width: 320px;
  transition: var(--transition-smooth);
}

.erp-search-bar:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
  width: 380px;
}

.erp-search-input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  width: 100%;
  margin-left: 8px;
}

.erp-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.erp-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition-fast);
}

.erp-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.erp-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  background: var(--color-primary-glow);
  color: var(--color-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.erp-admin-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
  text-shadow: none;
}

@media (max-width: 600px) {
  .erp-admin-btn span {
    display: none;
  }

  .erp-admin-btn {
    padding: 8px;
    border-radius: 50%;
  }
}

.erp-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--color-danger);
}

/* Page Content Base */
.erp-content {
  padding: 32px;
  flex-grow: 1;
}

/* ==========================================
   DASHBOARD COMPONENTS
   ========================================== */

/* Welcome Banner */
.erp-welcome-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 1px solid var(--border-glass-glow);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.erp-welcome-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.erp-welcome-title {
  font-size: 28px;
  background: linear-gradient(90deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.erp-welcome-desc {
  color: var(--text-secondary);
  max-width: 600px;
  font-size: 16px;
}

/* Statistics Grid */
.erp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
  align-items: stretch;
}

.erp-stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  height: 100%;
  box-sizing: border-box;
  animation: erpCardEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes erpCardEntrance {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.1);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.erp-stat-card:nth-child(1) {
  animation-delay: 0.05s;
}

.erp-stat-card:nth-child(2) {
  animation-delay: 0.15s;
}

.erp-stat-card:nth-child(3) {
  animation-delay: 0.25s;
}

.erp-stat-card:nth-child(4) {
  animation-delay: 0.35s;
}

.erp-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-primary);
  opacity: 0;
  transition: var(--transition-smooth);
}

.erp-stat-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--border-glass-glow);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(99, 102, 241, 0.15);
}

.erp-stat-card:hover::before {
  opacity: 1;
}

.erp-stat-card.cyan::before {
  background: var(--color-secondary);
}

.erp-stat-card.green::before {
  background: var(--color-success);
}

.erp-stat-card.purple::before {
  background: var(--color-accent);
}

.erp-stat-info {
  display: flex;
  flex-direction: column;
}

.erp-stat-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.erp-stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.2px;
}

.erp-stat-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.erp-stat-trend-up {
  color: var(--color-success);
  font-weight: 600;
}

.erp-stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: var(--transition-smooth);
  animation: livePulse 3s infinite;
}

.erp-stat-card:hover .erp-stat-icon {
  background: var(--color-primary-glow);
  color: var(--text-primary);
  border-color: var(--color-primary-glow);
}

.erp-stat-card.cyan .erp-stat-icon {
  color: var(--color-secondary);
}

.erp-stat-card.cyan:hover .erp-stat-icon {
  background: rgba(6, 182, 212, 0.15);
}

.erp-stat-card.green .erp-stat-icon {
  color: var(--color-success);
}

.erp-stat-card.green:hover .erp-stat-icon {
  background: rgba(16, 185, 129, 0.15);
}

.erp-stat-card.purple .erp-stat-icon {
  color: var(--color-accent);
}

.erp-stat-card.purple:hover .erp-stat-icon {
  background: rgba(168, 85, 247, 0.15);
}

/* Glowing Heartbeat Animation */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  position: relative;
}

.status-indicator::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  animation: pulse-glow 1.5s infinite ease-in-out;
}

@keyframes pulse-glow {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* Dashboard Section Grid */
.erp-dashboard-main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .erp-dashboard-main-grid {
    grid-template-columns: 1fr;
  }
}

/* Content Panel Card */
.erp-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.erp-panel-title-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 16px;
}

.erp-panel-title {
  font-size: 18px;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

/* ==========================================
   BLOG / POST CARD COMPONENT
   ========================================== */
.erp-post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.erp-post-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.erp-post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-md);
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.erp-post-card:hover {
  background: var(--bg-glass-hover);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: var(--shadow-md);
}

.erp-post-card:hover::before {
  background: linear-gradient(135deg, var(--color-primary), transparent 60%);
}

.erp-post-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.erp-post-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.erp-post-title {
  font-size: 18px;
  margin-bottom: 4px;
}

.erp-post-excerpt {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.erp-post-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-secondary);
  margin-top: auto;
}

.erp-post-link:hover {
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

/* System Logs Component (Right Sidebar of Dashboard) */
.erp-log-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.erp-log-item {
  display: flex;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.erp-log-item:last-child {
  border-bottom: none;
}

.erp-log-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.erp-log-badge.success {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

.erp-log-badge.info {
  background: var(--color-info);
  box-shadow: 0 0 6px var(--color-info);
}

.erp-log-badge.warning {
  background: var(--color-warning);
  box-shadow: 0 0 6px var(--color-warning);
}

.erp-log-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.erp-log-msg {
  font-size: 13px;
  color: var(--text-primary);
}

.erp-log-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* Footer Section */
.erp-footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 50;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-glass);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.erp-footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================
   WORDPRESS STANDARD FALLBACKS & CONTENT
   ========================================== */
.entry-content {
  margin-top: 20px;
}

.entry-content p {
  margin-bottom: 16px;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .erp-sidebar {
    transform: translateX(-100%);
    width: 240px;
  }

  .erp-main {
    margin-left: 0;
  }

  .erp-sidebar.active {
    transform: translateX(0);
  }

  .erp-header {
    padding: 0 16px;
  }

  .erp-search-bar {
    display: none;
    /* Hide search on mobile */
  }

  .erp-content {
    padding: 16px;
  }

  .erp-footer {
    left: 0;
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* Fix search overlap with browser native clear icon */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
}

/* ==========================================
   JQUERY UI DATEPICKER CUSTOM MODERN STYLING
   ========================================== */
.ui-datepicker {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  padding: 16px !important;
  font-family: var(--font-sans) !important;
  width: 280px !important;
  z-index: 9999 !important;
  /* Ensure it floats above all other elements */
}

/* Header Month & Year wrapper */
.ui-datepicker-header {
  background: transparent !important;
  border: none !important;
  color: var(--text-primary) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
  padding: 0 0 12px 0 !important;
  border-bottom: 1px solid var(--border-glass) !important;
  margin-bottom: 12px !important;
}

/* Dropdown select fields */
.ui-datepicker-title {
  margin: 0 !important;
  line-height: 1 !important;
  display: flex !important;
  gap: 6px !important;
  align-items: center !important;
}

.ui-datepicker-title select {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border-glass) !important;
  color: var(--text-primary) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 4px 6px !important;
  border-radius: var(--radius-sm) !important;
  outline: none !important;
  cursor: pointer !important;
  height: 28px !important;
  color-scheme: dark;
}

.ui-datepicker-month option,
.ui-datepicker-year option,
.ui-datepicker-title select option {
  background-color: #090d16 !important;
  color: #f8fafc !important;
}

/* Prev / Next buttons */
.ui-datepicker-prev,
.ui-datepicker-next {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: var(--radius-sm) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--border-glass) !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  transition: var(--transition-fast) !important;
}

.ui-datepicker-prev:hover,
.ui-datepicker-next:hover {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  border-color: var(--color-primary) !important;
}

.ui-datepicker-prev span,
.ui-datepicker-next span {
  display: block !important;
  text-indent: 0 !important;
  position: static !important;
  margin: 0 !important;
  font-size: 12px !important;
  font-weight: bold !important;
  color: inherit !important;
}

/* Calendar Days Grid Table */
.ui-datepicker-calendar {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 0 !important;
}

.ui-datepicker-calendar th {
  padding: 6px 0 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
  text-transform: uppercase !important;
  text-align: center !important;
}

.ui-datepicker-calendar td {
  padding: 2px !important;
  text-align: center !important;
}

/* Day item buttons styles */
.ui-datepicker-calendar .ui-state-default {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: var(--radius-sm) !important;
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: var(--transition-fast) !important;
  padding: 0 !important;
  margin: 0 auto !important;
}

.ui-datepicker-calendar .ui-state-default:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-primary) !important;
}

/* Selected Date Highlight */
.ui-datepicker-calendar .ui-state-active {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4) !important;
}

/* Disabled & Other Month Dates */
.ui-datepicker-other-month .ui-state-default {
  color: var(--text-muted) !important;
  opacity: 0.35 !important;
}

/* Fix browser autocomplete autofill dark background overlay */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #1e1e2f inset !important;
  -webkit-text-fill-color: #f8fafc !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Mobile Utility */
.erp-mobile-only {
  display: none !important;
}

/* ==========================================
   GLOBAL ERP CREATIVE BRAND LOADER COMPONENT
   ========================================== */
.pos-creative-loader-popup {
  border-radius: 20px !important;
  padding: 24px !important;
  background: rgba(15, 22, 38, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
}

.erp-creative-loader-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 10px;
  max-width: 100%;
  width: 100%;
  text-align: center;
}

.erp-loader-spinner-box {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.erp-loader-outer-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #6366f1;
  border-right-color: #06b6d4;
  animation: erpOuterSpin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.7));
}

.erp-loader-inner-ring {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-bottom-color: #10b981;
  border-left-color: #a855f7;
  animation: erpInnerSpin 1s linear infinite reverse;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
}

.erp-loader-brand-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  animation: erpLogoPulse 1.8s ease-in-out infinite;
  z-index: 2;
  overflow: hidden;
  padding: 4px;
  box-sizing: border-box;
}

.erp-loader-brand-icon.has-logo-img {
  background: transparent !important;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15) !important;
  padding: 0 !important;
  border-radius: 12px;
}

.erp-loader-brand-icon img.erp-loader-logo-img {
  width: 100% !important;
  height: 100% !important;
  max-width: 52px !important;
  max-height: 52px !important;
  object-fit: contain !important;
  border-radius: 10px !important;
  display: block !important;
  margin: 0 auto !important;
}

.erp-loader-m-logo {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: #ffffff;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.erp-loader-title {
  margin: 0 0 6px 0;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.erp-loader-subtitle {
  margin: 0 0 18px 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.erp-loader-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.erp-loader-progress-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #6366f1, #a855f7, #06b6d4, transparent);
  animation: erpShimmerMove 1.5s ease-in-out infinite;
}

@keyframes erpOuterSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes erpInnerSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes erpLogoPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes erpShimmerMove { 0% { left: -100%; } 100% { left: 100%; } }

.erp-swal-single-line-title {
  font-size: 19px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.pos-top-right-toast {
  border-radius: 12px !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.25) !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  padding: 12px 18px !important;
}

/* Sales KPI Card Base Styling */
.sales-kpi-card {
  flex: 1 1 120px;
  min-width: 110px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
.sales-kpi-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sales-kpi-val {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.sales-kpi-qty { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.25); }
.sales-kpi-qty .sales-kpi-title { color: #10b981; }
.sales-kpi-qty .sales-kpi-val { color: #ecfdf5; }

.sales-kpi-sale { background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.25); }
.sales-kpi-sale .sales-kpi-title { color: #60a5fa; }
.sales-kpi-sale .sales-kpi-val { color: #eff6ff; }

.sales-kpi-exchanges { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.25); }
.sales-kpi-exchanges .sales-kpi-title { color: #f59e0b; }
.sales-kpi-exchanges .sales-kpi-val { color: #fffbeb; }

.sales-kpi-returns { background: rgba(244, 63, 94, 0.08); border: 1px solid rgba(244, 63, 94, 0.25); }
.sales-kpi-returns .sales-kpi-title { color: #f43f5e; }
.sales-kpi-returns .sales-kpi-val { color: #fff1f2; }

.sales-kpi-netsale { background: rgba(99, 102, 241, 0.12); border: 1px solid rgba(99, 102, 241, 0.35); box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15); }
.sales-kpi-netsale .sales-kpi-title { color: #818cf8; }
.sales-kpi-netsale .sales-kpi-val { color: #e0e7ff; }

/* ==========================================
   UNIVERSAL MODAL CLOSE BUTTON STYLES
   ========================================== */
.erp-modal-close-btn,
.pos-modal-close,
.erp-close-modal,
.erp-close-import-modal,
.erp-close-image-modal,
#erp-order-modal-close,
#erp-stock-modal-close,
#erp-wh-modal-close,
#qa-modal-close,
button[class*="close-modal"],
button[id*="modal-close"] {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.15)) !important;
  background: var(--bg-secondary, rgba(15, 23, 42, 0.6)) !important;
  color: var(--text-secondary, #94a3b8) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  flex-shrink: 0 !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.erp-modal-close-btn:hover,
.pos-modal-close:hover,
.erp-close-import-modal:hover,
.erp-close-image-modal:hover,
#erp-order-modal-close:hover,
#erp-stock-modal-close:hover,
#erp-wh-modal-close:hover,
#qa-modal-close:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #ef4444 !important;
  transform: rotate(90deg) scale(1.05) !important;
}

/* Ensure text cancel buttons never rotate */
.btn-cancel,
.btn-cancel-modal,
#btn-cancel-wh-modal,
#qa-cancel-btn,
button[id*="cancel"] {
  transform: none !important;
  white-space: nowrap !important;
}