/* ==========================================================================
   WEBORDER PRO - COMPILED TAILWIND + GLASSMORPHISM ENTERPRISE DESIGN SYSTEM
   ========================================================================== */

:root {
  --bg-primary: #eef2fb;
  --bg-glass: rgba(255, 255, 255, 0.66);
  --bg-glass-strong: rgba(255, 255, 255, 0.88);
  --border-glass: rgba(255, 255, 255, 0.88);
  --border-subtle: rgba(203, 213, 225, 0.55);
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-indigo: #4f46e5;
  --accent-violet: #7c3aed;
  --accent-blue: #0ea5e9;
  --accent-mint: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #ef4444;
  --radius-card: 22px;
  --radius-lg: 26px;
  --shadow-soft: 0 16px 38px -8px rgba(15, 23, 42, 0.06), 0 6px 16px -3px rgba(79, 70, 229, 0.05), inset 0 1.5px 0 0 rgba(255, 255, 255, 0.96), inset 0 -1px 0 0 rgba(226, 232, 240, 0.45);
  --shadow-hover: 0 26px 52px -12px rgba(79, 70, 229, 0.18), 0 10px 24px -4px rgba(15, 23, 42, 0.07), inset 0 1.5px 0 0 #ffffff;
  --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-snappy: cubic-bezier(0.28, 1.72, 0.52, 1);
  --smooth-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(at 6% 10%, rgba(139, 92, 246, 0.24) 0px, transparent 48%),
    radial-gradient(at 92% 8%, rgba(14, 165, 233, 0.20) 0px, transparent 46%),
    radial-gradient(at 48% 45%, rgba(99, 102, 241, 0.13) 0px, transparent 52%),
    radial-gradient(at 84% 90%, rgba(16, 185, 129, 0.19) 0px, transparent 48%),
    radial-gradient(at 14% 86%, rgba(236, 72, 153, 0.11) 0px, transparent 44%);
  background-attachment: fixed;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient Floating Glass Orbs for True Frosted Refraction */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 9999px;
  filter: blur(72px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  animation: floatAmbientOrb 18s ease-in-out infinite alternate;
}
body::before {
  width: 420px;
  height: 420px;
  top: -80px;
  left: 240px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.28) 0%, rgba(56, 189, 248, 0.12) 70%, transparent 100%);
}
body::after {
  width: 460px;
  height: 460px;
  bottom: -100px;
  right: 6%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.24) 0%, rgba(99, 102, 241, 0.16) 70%, transparent 100%);
  animation-delay: -9s;
}
@keyframes floatAmbientOrb {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(36px, 24px, 0) scale(1.07); }
  100% { transform: translate3d(-24px, 40px, 0) scale(0.96); }
}

@keyframes springPopIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.94);
  }
  70% {
    opacity: 1;
    transform: translateY(-3px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Layout Architecture */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.app-sidebar {
  width: 268px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(245, 248, 255, 0.66) 100%);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-right: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 6px 0 32px rgba(15, 23, 42, 0.045), inset -1px 0 0 rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: width 0.36s var(--spring-ease), transform 0.36s var(--spring-ease);
}

.sidebar-header {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-glass);
  position: relative;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  position: relative;
}

.sidebar-brand-tooltip {
  display: none;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: transform 0.3s var(--spring-ease), background-color 0.2s ease, color 0.2s ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-indigo);
  transform: scale(1.1);
}

.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-glass);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e0e7ff, #ede9fe);
  color: #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
  position: relative;
}

.sidebar-user-avatar .sidebar-label,
.sidebar-logout-btn .sidebar-label {
  display: none;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #ef4444;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
  transition: transform 0.3s var(--spring-ease), background-color 0.2s ease;
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.06);
}

.sidebar-logout-btn .logout-icon-svg {
  display: none;
}

/* ============================================================================
   COLLAPSED SIDEBAR (ICON-ONLY MODE + SPRING HOVER NAME TOOLTIPS)
   ============================================================================ */
.app-sidebar.collapsed {
  width: 80px;
  overflow: visible !important;
}

.app-sidebar.collapsed .brand-text,
.app-sidebar.collapsed .sidebar-section-title,
.app-sidebar.collapsed .sidebar-collapse-btn,
.app-sidebar.collapsed .logout-text {
  display: none !important;
}

.app-sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 0 8px;
}

.app-sidebar.collapsed .sidebar-nav-scroll {
  overflow: visible !important;
  padding: 12px 0;
}

.app-sidebar.collapsed .nav-item {
  position: relative;
  justify-content: center;
  width: 48px;
  height: 46px;
  margin: 6px auto;
  padding: 0;
  border-radius: 14px;
}

.app-sidebar.collapsed .nav-item:hover {
  transform: scale(1.1);
}

.app-sidebar.collapsed .nav-item .sidebar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  margin: 0;
  padding: 1px 5px;
  font-size: 9.5px;
  min-width: 17px;
  text-align: center;
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
}

/* Floating Frosted-Glass Hover Label on Collapsed Icons */
.app-sidebar.collapsed .nav-item .sidebar-label,
.app-sidebar.collapsed .sidebar-pwa-btn .sidebar-label,
.app-sidebar.collapsed .sidebar-user-avatar .sidebar-label,
.app-sidebar.collapsed .sidebar-logout-btn .sidebar-label,
.app-sidebar.collapsed .sidebar-brand-tooltip {
  display: inline-flex !important;
  align-items: center;
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(-10px) scale(0.88);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 41, 59, 0.92) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 7px 14px;
  border-radius: 11px;
  white-space: nowrap;
  box-shadow: 0 14px 32px -4px rgba(15, 23, 42, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.18);
  z-index: 9999;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.36s var(--spring-ease);
}

.app-sidebar.collapsed .nav-item .sidebar-label::before,
.app-sidebar.collapsed .sidebar-pwa-btn .sidebar-label::before,
.app-sidebar.collapsed .sidebar-user-avatar .sidebar-label::before,
.app-sidebar.collapsed .sidebar-logout-btn .sidebar-label::before,
.app-sidebar.collapsed .sidebar-brand-tooltip::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(15, 23, 42, 0.94);
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.app-sidebar.collapsed .nav-item:hover .sidebar-label,
.app-sidebar.collapsed .sidebar-pwa-btn:hover .sidebar-label,
.app-sidebar.collapsed .sidebar-user-avatar:hover .sidebar-label,
.app-sidebar.collapsed .sidebar-logout-btn:hover .sidebar-label,
.app-sidebar.collapsed .sidebar-brand-link:hover .sidebar-brand-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0) scale(1);
}

/* Collapsed Footer Clean Vertical Stack (Zero Overlap) */
.app-sidebar.collapsed .sidebar-footer {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.app-sidebar.collapsed .sidebar-pwa-btn {
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  margin-bottom: 2px !important;
  border-radius: 13px !important;
  position: relative;
  justify-content: center;
}

.app-sidebar.collapsed .sidebar-user-card {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  width: 52px;
  border-radius: 14px;
}

.app-sidebar.collapsed .sidebar-logout-btn {
  padding: 7px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
}

.app-sidebar.collapsed .sidebar-logout-btn .logout-icon-svg {
  display: block;
}

.app-main {
  flex: 1;
  margin-left: 268px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.28s var(--smooth-ease);
}

.app-sidebar.collapsed ~ .app-main {
  margin-left: 80px;
}

.app-topbar {
  height: 72px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.76) 0%, rgba(255, 255, 255, 0.64) 100%);
  backdrop-filter: blur(26px) saturate(200%);
  -webkit-backdrop-filter: blur(26px) saturate(200%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 28px -6px rgba(15, 23, 42, 0.04), inset 0 -1px 0 rgba(255, 255, 255, 0.7);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  gap: 16px;
}

.app-content {
  padding: 24px 26px 96px 26px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Navigation Items */
.sidebar-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 14px 18px 6px 18px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10.5px 16px;
  margin: 4px 12px;
  border-radius: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.34s var(--spring-ease), background-color 0.22s ease, color 0.2s ease, box-shadow 0.28s var(--smooth-ease);
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.09);
  border-color: rgba(99, 102, 241, 0.16);
  color: var(--accent-indigo);
  transform: translateX(5px) scale(1.02);
}

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

.nav-item.active {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #7c3aed 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 24px -4px rgba(79, 70, 229, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateX(2px);
}

.nav-item .sidebar-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.nav-item.active .sidebar-badge {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

/* Frosted Glass Cards with Spring Physics */
.glass-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.54) 100%);
  backdrop-filter: blur(26px) saturate(200%);
  -webkit-backdrop-filter: blur(26px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft), 0 0 0 1px rgba(203, 213, 225, 0.34);
  transition: transform 0.38s var(--spring-ease), box-shadow 0.32s var(--smooth-ease), border-color 0.24s ease, background 0.24s ease;
  animation: springPopIn 0.52s var(--spring-ease) both;
}

.glass-card-interactive {
  position: relative;
  overflow: hidden;
}

.glass-card-interactive::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-22deg);
  transition: left 0.65s var(--smooth-ease);
  pointer-events: none;
}

.glass-card-interactive:hover::after {
  left: 140%;
}

.glass-card-interactive:hover {
  transform: translateY(-6px) scale(1.018);
  box-shadow: var(--shadow-hover), 0 0 0 1px rgba(99, 102, 241, 0.28);
  border-color: #ffffff;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.90) 0%, rgba(255, 255, 255, 0.68) 100%);
}

.glass-card-interactive:active {
  transform: translateY(-1px) scale(0.97);
}

/* Stat Cards Grid */
.stats-grid-10 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.stats-grid-10 > .stat-card:nth-child(1)  { animation-delay: 0ms; }
.stats-grid-10 > .stat-card:nth-child(2)  { animation-delay: 35ms; }
.stats-grid-10 > .stat-card:nth-child(3)  { animation-delay: 70ms; }
.stats-grid-10 > .stat-card:nth-child(4)  { animation-delay: 105ms; }
.stats-grid-10 > .stat-card:nth-child(5)  { animation-delay: 140ms; }
.stats-grid-10 > .stat-card:nth-child(6)  { animation-delay: 175ms; }
.stats-grid-10 > .stat-card:nth-child(7)  { animation-delay: 210ms; }
.stats-grid-10 > .stat-card:nth-child(8)  { animation-delay: 245ms; }
.stats-grid-10 > .stat-card:nth-child(9)  { animation-delay: 280ms; }
.stats-grid-10 > .stat-card:nth-child(10) { animation-delay: 315ms; }

@media (max-width: 1380px) {
  .stats-grid-10 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .stats-grid-10 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-width: 480px) {
  .stats-grid-10 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stats-grid-10 .stat-card {
    padding: 13px 12px !important;
    border-radius: 16px;
  }
  .stats-grid-10 .stat-icon-box {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
  }
}

.stat-card {
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 6px 14px -3px rgba(15, 23, 42, 0.08);
  transition: transform 0.42s var(--spring-snappy), box-shadow 0.3s ease;
}
.stat-card:hover .stat-icon-box {
  transform: scale(1.16) rotate(-7deg) translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 20px -4px rgba(79, 70, 229, 0.22);
}

/* Spring Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 13px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.34s var(--spring-ease), box-shadow 0.25s var(--smooth-ease), background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2.5px) scale(1.025);
}
.btn:active {
  transform: translateY(0) scale(0.94) !important;
}
.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #7c3aed 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 55%, #6d28d9 100%);
  box-shadow: 0 12px 26px -4px rgba(79, 70, 229, 0.50), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-mint {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 18px -4px rgba(16, 185, 129, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #334155;
  border-color: rgba(203, 213, 225, 0.85);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(99, 102, 241, 0.35);
  color: #4f46e5;
  box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.12);
}
.btn-soft-indigo {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.2);
}
.btn-soft-indigo:hover {
  background: rgba(99, 102, 241, 0.18);
}
.btn-soft-whatsapp {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
}
.btn-soft-whatsapp:hover {
  background: #10b981;
  color: #ffffff;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
}
.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 9px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3.5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-indigo  { background: #e0e7ff; color: #3730a3; }
.badge-violet  { background: #ede9fe; color: #5b21b6; }
.badge-blue    { background: #e0f2fe; color: #075985; }
.badge-slate   { background: #f1f5f9; color: #334155; }

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table th {
  background: rgba(248, 250, 252, 0.85);
  color: #475569;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  color: #1e293b;
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background-color 0.2s ease, transform 0.28s var(--spring-ease);
}
.data-table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.055);
}

/* Forms & Inputs */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}
.form-control {
  width: 100%;
  padding: 9.5px 13px;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.85);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  color: #0f172a;
  font-size: 13.5px;
  font-family: inherit;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
  transition: border-color 0.22s ease, box-shadow 0.28s var(--spring-ease), transform 0.28s var(--spring-ease), background 0.2s ease;
}
.form-control:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16), 0 6px 16px -4px rgba(79, 70, 229, 0.12);
  background: #ffffff;
  transform: translateY(-1px);
}

/* Modals with Frosted Glass & Spring Bounce */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-dialog {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 255, 0.88) 100%);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-radius: 24px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 70px -12px rgba(15, 23, 42, 0.28), inset 0 1.5px 0 rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.92);
  transform: scale(0.90) translateY(24px);
  transition: transform 0.42s var(--spring-ease);
}
.modal-backdrop.open .modal-dialog {
  transform: scale(1) translateY(0);
}
.modal-dialog.modal-xl {
  max-width: 1140px;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 390px;
}
.toast-item {
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 13px 18px;
  border-radius: 14px;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  animation: toastSlideIn 0.3s var(--spring-ease);
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 10px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Mobile Sidebar Backdrop */
.sidebar-mobile-backdrop {
  display: none;
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
  z-index: 45;
  justify-content: space-around;
  align-items: center;
  padding-left: 6px;
  padding-right: 6px;
}
.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 12px;
  flex: 1;
  max-width: 76px;
  transition: transform 0.25s var(--spring-ease), background-color 0.2s ease, color 0.2s ease;
}
.mobile-nav-btn:active {
  transform: scale(0.92);
}
.mobile-nav-btn.active {
  color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.11);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .app-sidebar {
    transform: translateX(-104%);
    width: 274px !important;
    z-index: 60;
    box-shadow: 20px 0 50px rgba(15, 23, 42, 0.22);
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
    width: 274px !important;
    overflow: hidden !important;
  }
  /* Always display full menu labels when mobile drawer is open, even if .collapsed was active */
  .app-sidebar.mobile-open .brand-text,
  .app-sidebar.mobile-open .sidebar-section-title,
  .app-sidebar.mobile-open .logout-text {
    display: block !important;
  }
  .app-sidebar.mobile-open .sidebar-collapse-btn {
    display: none !important;
  }
  .app-sidebar.mobile-open .nav-item {
    width: auto !important;
    height: auto !important;
    justify-content: flex-start !important;
    padding: 10.5px 16px !important;
    margin: 4px 12px !important;
  }
  .app-sidebar.mobile-open .nav-item .sidebar-label {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-size: 13.5px !important;
  }
  .app-sidebar.mobile-open .nav-item .sidebar-label::before {
    display: none !important;
  }
  .sidebar-mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }
  .app-sidebar.mobile-open ~ .sidebar-mobile-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .app-main,
  .app-sidebar.collapsed ~ .app-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .app-content {
    padding: 14px 12px calc(86px + env(safe-area-inset-bottom, 0px)) 12px;
  }
  .app-topbar {
    padding: 8px 12px;
  }
}

@media (max-width: 768px) {
  /* Clean 2-Row Mobile Topbar (Fixes Overlapping Title & Squished Search Bar) */
  .app-topbar {
    height: auto !important;
    min-height: 58px;
    flex-wrap: wrap;
    padding: 10px 12px !important;
    gap: 8px !important;
  }
  .topbar-left {
    flex: 1 1 55% !important;
    min-width: 0 !important;
    gap: 10px !important;
  }
  .topbar-breadcrumb {
    font-size: 10px !important;
  }
  #topbar-title {
    font-size: 14px !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .topbar-actions {
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  .topbar-backup-btn .topbar-btn-label {
    display: none !important;
  }
  .topbar-backup-btn {
    padding: 7px 9px !important;
  }
  .topbar-new-order-btn .topbar-order-label {
    display: none !important;
  }
  .topbar-new-order-btn .topbar-order-short {
    display: inline !important;
  }
  .topbar-new-order-btn {
    padding: 7px 11px !important;
    font-size: 12px !important;
  }
  .topbar-search-wrap {
    order: 3;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  #global-search-input {
    height: 38px;
    font-size: 13px !important;
    padding: 7px 12px !important;
  }
  #notif-popover {
    position: fixed !important;
    top: 62px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
  }

  /* Responsive Glass Cards & Section Padding */
  .glass-card {
    border-radius: 18px;
  }
  .app-content > .glass-card,
  .app-content .glass-card {
    padding: 14px !important;
  }

  /* Auto-Stack Inline Multi-Column Grids on Mobile */
  .app-content div[style*="grid-template-columns"]:not(.stats-grid-10),
  .modal-body div[style*="grid-template-columns"]:not(.inline-pitem-row):not(.doc-line-row),
  .modal-body form[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Line-Item Builders in Modals (Project Items / Quotation / Invoice Rows) */
  .inline-pitem-row,
  .doc-line-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 10px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
  }
  .inline-pitem-row > *:nth-child(1),
  .inline-pitem-row > *:nth-child(2),
  .doc-line-row > *:nth-child(1) {
    grid-column: 1 / -1 !important;
  }

  /* Mobile-Friendly Horizontal Scroll Tables (Prevents 1-word-per-line squishing) */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    border-radius: 12px;
    margin: 0 -2px;
    padding-bottom: 4px;
  }
  .data-table {
    min-width: 660px;
    font-size: 12px;
  }
  .data-table th {
    padding: 9px 10px;
    font-size: 10.5px;
  }
  .data-table td {
    padding: 10px 10px;
    font-size: 12px;
  }

  /* Mobile Modals & Bottom-Sheet Ergonomics */
  .modal-backdrop {
    padding: 8px;
    align-items: flex-end;
  }
  .modal-dialog {
    max-height: 92vh;
    border-radius: 20px;
  }
  .modal-header {
    padding: 14px 16px;
  }
  .modal-body {
    padding: 14px 16px;
  }
  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .modal-footer .btn {
    flex: 1 1 auto;
  }

  /* Toast Notification Placement Above Mobile Bottom Nav */
  .toast-container {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    max-width: none;
  }

  /* Auth Login Card on Mobile */
  #auth-screen {
    padding: 14px !important;
  }
  #auth-screen > .glass-card {
    padding: 24px 20px !important;
    border-radius: 20px !important;
  }
}

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Tabs */
.tab-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: rgba(226, 232, 240, 0.55);
  padding: 5px;
  border-radius: 14px;
}
.tab-pill {
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
}
.tab-pill.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

/* Logo Avatars & Upload Dropzones */
.logo-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 2px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
}
.logo-avatar-lg {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 4px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}
.logo-upload-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1.5px dashed rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.65) 0%, rgba(255, 255, 255, 0.85) 100%);
  transition: all 0.2s ease;
}
.logo-upload-zone:hover {
  border-color: #4f46e5;
  background: rgba(238, 242, 255, 0.9);
}
.wop-svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}


