/* ============================================================
   OpticClose Platform — Cinematic OS Restyle
   platform.css — Overrides app.html embedded styles
   Design Language: Deep dark, glass-morphism, aurora accents
   ============================================================ */

/* ── Google Fonts Override ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Custom Properties Override ── */
:root {
  /* Core palette — premium dark */
  --bg-primary:     #06060b;
  --bg-secondary:   #0a0a16;
  --bg-card:        rgba(12, 12, 28, 0.65);
  --bg-card-solid:  #0c0c1e;
  --bg-elevated:    #111128;
  --bg-surface:     #0c0c1d;

  /* Accent colors — electric cyan/violet aurora */
  --accent:         #00b4d8;
  --accent-dim:     rgba(0, 180, 216, 0.10);
  --accent-glow:    rgba(0, 180, 216, 0.25);
  --accent-blue:    #00b4d8;
  --accent-blue-dim: rgba(0, 180, 216, 0.10);
  --accent-blue-glow: rgba(0, 180, 216, 0.25);
  --accent-cyan:    #22d3ee;
  --accent-purple:  #7c3aed;
  --accent-gold:    #f59e0b;

  /* Text */
  --text-primary:   #f0f0f8;
  --text-secondary: #a0a8c0;
  --text-muted:     #606880;

  /* Borders */
  --border:         rgba(255, 255, 255, 0.06);
  --border-glow:    rgba(0, 180, 216, 0.18);

  /* Glass */
  --glass-bg:       rgba(10, 10, 26, 0.55);
  --glass-border:   rgba(255, 255, 255, 0.06);
  --glass-blur:     24px;
  --glass-hover:    rgba(255, 255, 255, 0.06);

  /* Glows */
  --glow-sm:  0 0 16px rgba(0, 180, 216, 0.12);
  --glow-md:  0 0 32px rgba(0, 180, 216, 0.14);
  --glow-lg:  0 4px 48px rgba(0, 180, 216, 0.16);

  /* Shadows */
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.03);

  /* Status */
  --danger:   #ff4d6a;
  --warning:  #ffb84d;
  --info:     #4da6ff;
  --success:  #00d4aa;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);

  /* 3D Mode */
  --perspective:    1200px;
  --tilt-max:       8deg;
  --tilt-speed:     400ms;
}

/* ── Font Override ── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  background: var(--bg-primary) !important;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 100, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 95%, rgba(124, 58, 237, 0.05) 0%, transparent 50%) !important;
  background-attachment: fixed !important;
  color: var(--text-primary) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, sans-serif !important;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 180, 216, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 180, 216, 0.3); }
* { scrollbar-width: thin; scrollbar-color: rgba(0,168,255,0.15) transparent; }

/* ============================================================
   SIDEBAR — Cinematic Glass
   ============================================================ */
.sidebar {
  background: rgba(6, 6, 16, 0.92) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.5), inset -1px 0 0 rgba(0,168,255,0.04) !important;
}

.sidebar-header {
  padding: 24px 20px 20px !important;
}

.sidebar-header::after {
  background: linear-gradient(90deg, transparent, rgba(0, 180, 216, 0.3), rgba(124, 58, 237, 0.15), transparent) !important;
}

.logo {
  font-family: 'Inter', sans-serif !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  letter-spacing: 0.15em !important;
  text-transform: uppercase !important;
}

.logo span { color: var(--accent) !important; }

.logo-brand {
  font-family: 'Inter', sans-serif !important;
  font-size: 21px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  background: linear-gradient(135deg, #ffffff 0%, #a8c4ff 60%, #7c3aed 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Nav Items */
.nav-item {
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  transition: all 0.25s var(--ease-out-expo) !important;
  position: relative !important;
}

.nav-item svg {
  transition: transform 0.3s var(--ease-spring), opacity 0.2s !important;
}

.nav-item:hover svg {
  transform: scale(1.1) !important;
  opacity: 1 !important;
}

.nav-item:hover {
  background: rgba(0, 180, 216, 0.06) !important;
  color: var(--text-primary) !important;
  border-color: rgba(0, 180, 216, 0.1) !important;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.12), rgba(124, 58, 237, 0.08)) !important;
  color: #fff !important;
  border-color: rgba(0, 180, 216, 0.2) !important;
  box-shadow: 0 0 24px rgba(0, 180, 216, 0.1), inset 0 0 12px rgba(0, 180, 216, 0.04) !important;
}

.nav-item.active::before {
  background: linear-gradient(180deg, var(--accent-blue), var(--accent-purple)) !important;
  box-shadow: 0 0 8px var(--accent-blue) !important;
  width: 3px !important;
  border-radius: 0 3px 3px 0 !important;
}

/* Active accent bar animation */
.nav-item.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent-blue), var(--accent-purple));
  box-shadow: 0 0 8px var(--accent-blue);
  animation: accentPulse 2s ease-in-out infinite;
}

@keyframes accentPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent-blue); }
  50%      { opacity: 0.7; box-shadow: 0 0 14px var(--accent-blue), 0 0 28px rgba(0,168,255,0.2); }
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.sidebar-footer::before {
  background: linear-gradient(90deg, transparent, rgba(0, 180, 216, 0.2), rgba(124, 58, 237, 0.1), transparent) !important;
}

.nav-item.logout {
  color: var(--danger) !important;
}

.nav-item.logout:hover {
  background: rgba(255, 77, 106, 0.08) !important;
  border-color: rgba(255, 77, 106, 0.12) !important;
}

/* Nav Section Labels */
.nav-section-label {
  font-family: 'Inter', sans-serif !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  color: var(--text-muted) !important;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-content {
  background: transparent !important;
  position: relative !important;
  overflow-x: hidden !important;
}

/* Page Header */
.page-title {
  font-family: 'Inter', sans-serif !important;
  font-size: 28px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  background: linear-gradient(135deg, #ffffff 0%, #c0d0ff 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* ============================================================
   BUTTONS — Premium Styling
   ============================================================ */
.btn {
  font-family: 'Inter', sans-serif !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  transition: all 0.25s var(--ease-out-expo) !important;
  position: relative !important;
  overflow: hidden !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%) !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.2), 0 4px 12px rgba(0,0,0,0.3) !important;
  border: none !important;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-primary:hover::before { opacity: 1; }

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(0, 180, 216, 0.4), 0 8px 24px rgba(0,0,0,0.4) !important;
  transform: translateY(-1px) !important;
}

.btn-primary:active {
  transform: translateY(0) scale(0.98) !important;
}

.btn-secondary {
  background: rgba(10, 10, 26, 0.6) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
}

.btn-secondary:hover {
  border-color: rgba(0, 180, 216, 0.2) !important;
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.08) !important;
  background: rgba(0, 180, 216, 0.06) !important;
}

.btn-ghost:hover {
  color: var(--text-primary) !important;
  background: rgba(0, 180, 216, 0.06) !important;
}

/* ============================================================
   CARDS — Glass Morphism
   ============================================================ */
.card {
  background: rgba(10, 10, 26, 0.55) !important;
  backdrop-filter: blur(20px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.02) !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.4s var(--ease-out-expo) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Card top glow line */
.card::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 1px !important;
  background: linear-gradient(90deg, transparent, rgba(0, 180, 216, 0.2), rgba(124, 58, 237, 0.15), transparent) !important;
  opacity: 0.6 !important;
}

.card:hover {
  border-color: rgba(0, 180, 216, 0.15) !important;
  box-shadow: 0 8px 40px rgba(0, 180, 216, 0.08), 0 4px 24px rgba(0, 0, 0, 0.4) !important;
}

/* ============================================================
   STAT CARDS — Premium Treatment
   ============================================================ */
.stats-grid {
  gap: 16px !important;
}

.stat-card {
  background: rgba(10, 10, 26, 0.6) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.02) !important;
  transition: all 0.35s var(--ease-out-expo) !important;
  position: relative !important;
  overflow: hidden !important;
}

.stat-card::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 1px !important;
  background: linear-gradient(90deg, transparent, rgba(0, 180, 216, 0.25), rgba(124, 58, 237, 0.15), transparent) !important;
}

/* Shimmer overlay */
.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 180, 216, 0.03), transparent);
  animation: cardShimmer 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes cardShimmer {
  0%   { left: -100%; }
  50%  { left: 100%; }
  100% { left: 100%; }
}

.stat-card:hover {
  border-color: rgba(0, 180, 216, 0.18) !important;
  box-shadow: 0 8px 40px rgba(0, 180, 216, 0.1), 0 0 0 1px rgba(0,168,255,0.08) !important;
  transform: translateY(-3px) !important;
}

.stat-label {
  font-family: 'Inter', sans-serif !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  color: var(--text-secondary) !important;
}

.stat-value {
  font-family: 'Inter', sans-serif !important;
  font-size: 32px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  color: var(--text-primary) !important;
}

.stat-change.positive {
  color: var(--success) !important;
}

.stat-change.negative {
  color: var(--danger) !important;
}

/* ============================================================
   TABLES — Dark Themed
   ============================================================ */
table {
  border-collapse: collapse;
  width: 100%;
}

th {
  font-family: 'Inter', sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--text-muted) !important;
  padding: 12px 16px !important;
  text-align: left !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  background: rgba(0, 0, 0, 0.2) !important;
  position: relative !important;
}

td {
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  color: var(--text-primary) !important;
  padding: 14px 16px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  transition: background 0.2s !important;
}

tr:hover td {
  background: rgba(0, 180, 216, 0.03) !important;
}

/* Sortable header feedback */
th[onclick]:hover,
th.sortable:hover {
  color: var(--accent-blue) !important;
  cursor: pointer !important;
}

/* ============================================================
   FORMS & INPUTS — Floating Labels
   ============================================================ */
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
  font-family: 'Inter', sans-serif !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  color: var(--text-primary) !important;
  font-size: 14px !important;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s !important;
  outline: none !important;
}

.form-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-blue) !important;
  background: rgba(0, 180, 216, 0.04) !important;
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1), 0 0 20px rgba(0, 180, 216, 0.06) !important;
}

/* Select dropdowns */
select {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23606880' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 36px !important;
}

/* Toggle switches */
input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 40px !important;
  height: 22px !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  position: relative !important;
  cursor: pointer !important;
  transition: background 0.3s !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

input[type="checkbox"]::after {
  content: '' !important;
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: var(--text-secondary) !important;
  transition: transform 0.3s var(--ease-spring), background 0.3s !important;
}

input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan)) !important;
  border-color: transparent !important;
}

input[type="checkbox"]:checked::after {
  transform: translateX(18px) !important;
  background: #fff !important;
}

/* ============================================================
   MODALS & DIALOGS — Glass Treatment
   ============================================================ */
.modal-overlay,
.slide-panel-overlay,
[class*="overlay"] {
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.modal-content,
.modal-body,
.slide-panel {
  background: rgba(12, 12, 28, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(0, 180, 216, 0.04) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
}

/* ============================================================
   TOAST NOTIFICATIONS — Glass Morphism
   ============================================================ */
.toast-container {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.toast {
  background: rgba(12, 12, 28, 0.92) !important;
  backdrop-filter: blur(24px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 14px 20px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  color: var(--text-primary) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  animation: toastSlideIn 0.4s var(--ease-out-expo) !important;
  position: relative !important;
  overflow: hidden !important;
}

.toast::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 3px !important;
  border-radius: 3px 0 0 3px !important;
}

.toast-success::before,
.toast.success::before {
  background: linear-gradient(180deg, var(--success), #00b4d8) !important;
  box-shadow: 0 0 12px rgba(0, 212, 170, 0.4) !important;
}

.toast-error::before,
.toast.error::before {
  background: linear-gradient(180deg, var(--danger), #ff8a80) !important;
  box-shadow: 0 0 12px rgba(255, 77, 106, 0.4) !important;
}

.toast-info::before,
.toast.info::before {
  background: linear-gradient(180deg, var(--info), var(--accent-cyan)) !important;
  box-shadow: 0 0 12px rgba(0, 180, 216, 0.4) !important;
}

.toast-warning::before,
.toast.warning::before {
  background: linear-gradient(180deg, var(--warning), #ffd54f) !important;
  box-shadow: 0 0 12px rgba(255, 184, 77, 0.4) !important;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ============================================================
   PERIOD SELECTOR / TAB BAR
   ============================================================ */
.period-selector {
  background: rgba(6, 6, 16, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 10px !important;
  backdrop-filter: blur(12px) !important;
}

.period-btn,
.tab-btn {
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  transition: all 0.2s var(--ease-out-expo) !important;
}

.period-btn.active,
.tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.15), rgba(124, 58, 237, 0.1)) !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(0, 180, 216, 0.1) !important;
}

/* ============================================================
   STATUS BADGES / TAGS
   ============================================================ */
.badge,
.status-badge,
.tag {
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  letter-spacing: 0.03em !important;
}

/* ============================================================
   LOADING / SKELETON STATES
   ============================================================ */
.skeleton,
.loading-skeleton {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.03) 75%
  ) !important;
  background-size: 200% 100% !important;
  animation: skeletonShimmer 1.5s ease-in-out infinite !important;
  border-radius: 8px !important;
}

@keyframes skeletonShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================================
   HAMBURGER / MOBILE NAV
   ============================================================ */
.hamburger {
  background: rgba(10, 10, 26, 0.85) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  transition: all 0.2s !important;
}

.hamburger:hover {
  border-color: rgba(0, 180, 216, 0.2) !important;
  box-shadow: 0 0 16px rgba(0, 180, 216, 0.1) !important;
}

.sidebar-overlay {
  backdrop-filter: blur(4px) !important;
}

/* ============================================================
   COPYRIGHT FOOTER — Fixed to bottom, OUT of flex flow
   ============================================================ */
.app-copyright {
  font-family: 'Inter', sans-serif !important;
  font-size: 11px !important;
  color: var(--text-muted) !important;
  opacity: 0.5 !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 250px !important;
  right: 0 !important;
  margin-left: 0 !important;
  text-align: center !important;
  padding: 10px 20px !important;
  z-index: 10 !important;
  pointer-events: none !important;
  background: linear-gradient(to top, rgba(6, 6, 11, 0.8) 0%, transparent 100%) !important;
}

/* ============================================================
   3D MODE — Perspective Container
   ============================================================ */
body.mode-3d .stats-grid,
body.mode-3d .card,
body.mode-3d .stat-card {
  transform-style: preserve-3d;
}

body.mode-3d .main-content {
  perspective: var(--perspective);
}

/* 3D floating effect for cards */
body.mode-3d .stat-card,
body.mode-3d .card {
  transform: translateZ(0);
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease !important;
}

body.mode-3d .stat-card:hover {
  transform: translateZ(20px) translateY(-4px) !important;
  box-shadow: 0 20px 60px rgba(0, 180, 216, 0.12), 0 0 0 1px rgba(0,168,255,0.1) !important;
}

/* ============================================================
   PARTICLE CANVAS (ambient background)
   ============================================================ */
#platform-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* ============================================================
   LAYOUT FIX — Desktop sidebar + full-width content
   ============================================================ */

/* Desktop: sidebar always visible, content fills remaining space */
@media (min-width: 769px) {
  /* Break the flex row — force column stacking so copyright doesn't sit
     beside main-content and compete for horizontal space */
  .app-layout {
    display: block !important;
    min-height: 100vh !important;
  }

  .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 250px !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    transform: none !important;
    opacity: 1 !important;
    z-index: 100 !important;
    overflow-y: auto !important;
    background: rgba(6, 6, 16, 0.92) !important;
  }

  .hamburger {
    display: none !important;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .main-content {
    margin-left: 250px !important;
    width: calc(100% - 250px) !important;
    min-height: 100vh !important;
    padding: 24px 32px !important;
    padding-bottom: 48px !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 1 !important;
    overflow-x: hidden !important;
  }

  /* Desktop copyright — fixed to bottom right of content area */
  .app-copyright {
    left: 250px !important;
  }
}

/* Ensure main-content z-index for particle canvas layering */
.main-content {
  position: relative;
  z-index: 1;
}

.sidebar {
  position: fixed !important;
  z-index: 100;
}

/* ============================================================
   3D TOGGLE BUTTON (Top Bar)
   ============================================================ */
.threed-toggle {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  letter-spacing: 0.02em;
}

.threed-toggle:hover {
  border-color: rgba(0, 180, 216, 0.3);
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.1);
}

.threed-toggle.active {
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.15), rgba(124, 58, 237, 0.1));
  border-color: rgba(0, 180, 216, 0.3);
  color: var(--accent-blue);
  box-shadow: 0 0 24px rgba(0, 180, 216, 0.15);
}

.threed-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.4s var(--ease-spring);
}

.threed-toggle.active svg {
  transform: rotateY(180deg);
}

/* ============================================================
   KEYBOARD SHORTCUTS OVERLAY
   ============================================================ */
.shortcuts-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.shortcuts-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.shortcuts-card {
  background: rgba(12, 12, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 32px 36px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  backdrop-filter: blur(24px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(0, 180, 216, 0.04);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.4s var(--ease-out-expo);
}

.shortcuts-overlay.open .shortcuts-card {
  transform: scale(1) translateY(0);
}

.shortcuts-card h2 {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #fff, #a8c4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shortcut-section {
  margin-bottom: 20px;
}

.shortcut-section h3 {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.shortcut-row:last-child {
  border-bottom: none;
}

.shortcut-label {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
}

.shortcut-keys {
  display: flex;
  gap: 4px;
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */
.page-transition-enter {
  animation: pageEnter 0.35s var(--ease-out-expo) forwards;
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #platform-particles {
    display: none !important;
  }

  .stat-card::after {
    animation: none !important;
  }

  .shortcuts-card,
  .shortcuts-overlay {
    transition: none !important;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE LAYOUT (≤768px)
   ============================================================ */
@media (max-width: 768px) {
  /* Prevent horizontal scroll on mobile */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* App layout: stack vertically on mobile */
  .app-layout {
    flex-direction: column !important;
    min-height: 100vh !important;
  }

  /* Sidebar: hidden off-screen, slides in when .open */
  .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 260px !important;
    height: 100vh !important;
    transform: translateX(-100%) !important;
    z-index: 1000 !important;
    transition: transform 0.3s ease !important;
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }

  /* CRITICAL: Content area must fill full mobile width */
  .main-content,
  #main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding: 16px !important;
    padding-top: 60px !important;
    box-sizing: border-box !important;
    transform: none !important;
    position: relative !important;
    left: 0 !important;
    overflow-x: hidden !important;
    flex: 1 1 100% !important;
  }

  /* FIX: Copyright footer — override fixed positioning for mobile */
  .app-copyright {
    margin-left: 0 !important;
    width: 100% !important;
    text-align: center !important;
    padding: 16px !important;
    position: relative !important;
    float: none !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    background: none !important;
    pointer-events: auto !important;
  }

  /* Cards: single column, full width */
  .stats-grid,
  .cc-kpi-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .cc-3col,
  .cc-2col,
  .cc-4col,
  .two-col,
  .three-col {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }

  /* Individual cards fill width */
  .stat-card,
  .cc-kpi-card,
  .card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  /* Footer: proper position at bottom */
  footer,
  .footer,
  .mc-footer {
    position: relative !important;
    width: 100% !important;
    text-align: center !important;
    float: none !important;
    right: auto !important;
    top: auto !important;
  }

  /* Hamburger visible on mobile */
  .hamburger {
    display: flex !important;
  }

  /* Sidebar overlay */
  .sidebar-overlay {
    display: none;
  }

  .sidebar-overlay.show {
    display: block !important;
  }

  /* 3D toggle smaller on mobile */
  .threed-toggle {
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .shortcuts-card {
    padding: 24px 20px;
  }

  /* Page header responsive */
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  /* Filter bar responsive */
  .filter-bar {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .filter-bar .form-select,
  .filter-bar .form-input {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 480px) {
  .threed-toggle {
    display: none;
  }

  .stats-grid,
  .cc-kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* ============================================================
   AURORA ACCENT LINE — Top of page
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 180, 216, 0.4) 20%,
    rgba(124, 58, 237, 0.3) 50%,
    rgba(0, 229, 255, 0.4) 80%,
    transparent 100%
  );
  z-index: 10000;
  pointer-events: none;
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state p {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================================
   SEARCH INPUT
   ============================================================ */
input[type="search"],
.search-input {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  padding: 10px 16px 10px 38px !important;
  font-family: 'Inter', sans-serif !important;
  color: var(--text-primary) !important;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination button,
.pagination a {
  font-family: 'Inter', sans-serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  color: var(--text-secondary) !important;
  transition: all 0.2s !important;
}

.pagination button:hover,
.pagination a:hover {
  background: rgba(0, 180, 216, 0.08) !important;
  border-color: rgba(0, 180, 216, 0.2) !important;
  color: var(--text-primary) !important;
}

.pagination .active {
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.15), rgba(124, 58, 237, 0.1)) !important;
  border-color: rgba(0, 180, 216, 0.3) !important;
  color: #fff !important;
}

/* ============================================================
   ICONS — Consistent Stroke Weight
   ============================================================ */
.nav-item svg,
.btn svg,
.stat-label svg {
  stroke-width: 1.8px;
}

/* ============================================================
   AUTH PAGE (in-app login) — Match cinematic login
   ============================================================ */
#auth-page {
  background: #000 !important;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.auth-card {
  background: rgba(10, 10, 26, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  padding: 40px !important;
  backdrop-filter: blur(24px) !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6) !important;
}

/* ============================================================
   EOD OVERLAY — Premium Treatment
   ============================================================ */
.eod-overlay {
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

.eod-content,
.eod-card {
  background: rgba(12, 12, 28, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px !important;
  backdrop-filter: blur(24px) !important;
}

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-container,
[class*="chart-"] {
  border-radius: 14px !important;
}

/* ============================================================
   DROPDOWN MENUS
   ============================================================ */
.dropdown-menu,
[class*="dropdown"] {
  background: rgba(12, 12, 28, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
}

.dropdown-item:hover {
  background: rgba(0, 180, 216, 0.06) !important;
}

/* ============================================================
   SLIDE PANELS — Premium Glass
   ============================================================ */
.slide-panel,
[class*="slide-panel"],
[class*="detail-panel"] {
  background: rgba(8, 8, 20, 0.98) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5) !important;
}

/* ============================================================
   PROGRESS BARS
   ============================================================ */
progress,
.progress-bar {
  border-radius: 4px !important;
  overflow: hidden !important;
}

.progress-bar {
  background: rgba(255, 255, 255, 0.04) !important;
}

.progress-fill,
progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan)) !important;
  border-radius: 4px !important;
}

/* ============================================================
   TOOLTIPS
   ============================================================ */
[data-tooltip]::after,
.tooltip {
  font-family: 'Inter', sans-serif !important;
  font-size: 12px !important;
  background: rgba(12, 12, 28, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  color: var(--text-primary) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
  backdrop-filter: blur(16px) !important;
}

/* ============================================================
   DASHBOARD CARDS — Full-width responsive grid
   ============================================================ */
@media (min-width: 769px) {
  .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .cc-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .stat-card,
  .cc-kpi-card {
    min-width: 0 !important;
    overflow: hidden !important;
  }
}

/* ============================================================
   PREMIUM POLISH — Background, card enhancement, accents
   ============================================================ */

/* Deep dark body background */
body {
  background-color: #06060b !important;
}

/* Card premium glass treatment */
.card,
.stat-card,
.cc-kpi-card {
  background: rgba(255, 255, 255, 0.03) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 16px !important;
  transition: all 0.2s ease !important;
}

.card:hover,
.stat-card:hover,
.cc-kpi-card:hover {
  box-shadow: 0 0 30px rgba(0, 180, 216, 0.12) !important;
  transform: translateY(-2px) !important;
  border-color: rgba(0, 180, 216, 0.15) !important;
}

/* Sidebar active link accent bar — electric cyan */
.nav-item.active::after {
  background: linear-gradient(180deg, #00b4d8, var(--accent-purple)) !important;
  box-shadow: 0 0 8px #00b4d8 !important;
}

.nav-item.active::before {
  background: linear-gradient(180deg, #00b4d8, var(--accent-purple)) !important;
  box-shadow: 0 0 8px #00b4d8 !important;
}

/* Text color polish */
.page-title {
  color: #f0f0f5 !important;
  -webkit-text-fill-color: unset !important;
  background: linear-gradient(135deg, #f0f0f5 0%, #c0d0ff 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Accent color override to electric cyan */
.btn-primary {
  background: linear-gradient(135deg, #00b4d8 0%, #00e5ff 100%) !important;
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(0, 180, 216, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

/* Active nav item glow with electric cyan */
.nav-item.active {
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.12), rgba(124, 58, 237, 0.08)) !important;
  box-shadow: 0 0 24px rgba(0, 180, 216, 0.1), inset 0 0 12px rgba(0, 180, 216, 0.04) !important;
}

/* ============================================================
   FUTURISTIC COMMAND CENTER — Premium Enhancements
   ============================================================ */

/* ── Premium card glass-morphism with cyan glow ── */
.dashboard-card,
.module-card,
[class*="card"]:not(.login-card):not(.auth-card):not(.shortcuts-card):not(.eod-card):not(.mc-card) {
  background: rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(0, 180, 216, 0.12) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.dashboard-card:hover,
.module-card:hover,
.stat-card:hover,
.cc-kpi-card:hover,
.card:hover {
  border-color: rgba(0, 180, 216, 0.3) !important;
  box-shadow: 0 8px 40px rgba(0, 180, 216, 0.15), 0 0 60px rgba(0, 180, 216, 0.05) !important;
  transform: translateY(-2px) !important;
}

/* ── Sidebar premium hover glow ── */
.sidebar a:hover,
.nav-item:hover {
  background: rgba(0, 180, 216, 0.06) !important;
  color: #e0e0e5 !important;
}

.sidebar a.active,
.sidebar a[class*="active"],
.nav-item.active {
  border-left: 3px solid #00b4d8 !important;
  background: rgba(0, 180, 216, 0.08) !important;
  color: #00e5ff !important;
}

/* ── Page headings — gradient text ── */
h1, h2, .page-title, .module-title {
  background: linear-gradient(135deg, #ffffff, #00b4d8) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-weight: 700 !important;
}

/* Don't apply gradient text to elements inside cards/modals where it breaks readability */
.card h3, .card h4, .stat-card h3, .stat-card h4,
.modal-content h2, .modal-content h3,
.coach-domain-card div,
.toast h3, .toast h4 {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  background-clip: unset !important;
}

/* ── Buttons — premium rounded with glow hover ── */
button:not(.hamburger):not(.nav-item):not(.coach-tab-btn):not(.threed-toggle):not(.mc-close),
.btn,
[class*="btn"]:not(.hamburger):not(.nav-item) {
  border-radius: 12px !important;
  transition: all 0.3s ease !important;
}

button:hover:not(.hamburger):not(.nav-item),
.btn:hover {
  box-shadow: 0 0 20px rgba(0, 180, 216, 0.3) !important;
}

/* ── Scheduling grid premium styling ── */
.schedule-grid,
.calendar-grid,
[class*="calendar"],
.week-grid,
.day-grid {
  border: 1px solid rgba(0, 180, 216, 0.08) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

/* ── Tab styling — active tabs glow cyan ── */
.tab.active,
[class*="tab"].active,
.coach-tab-btn.active,
.tab-btn.active,
.period-btn.active {
  background: rgba(0, 180, 216, 0.15) !important;
  border-color: #00b4d8 !important;
  color: #00e5ff !important;
  box-shadow: 0 0 12px rgba(0, 180, 216, 0.1) !important;
}

/* ── Table rows — subtle hover glow ── */
tr:hover td {
  background: rgba(0, 180, 216, 0.04) !important;
}

/* ── Input focus glow upgrade ── */
.form-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: #00b4d8 !important;
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15), 0 0 20px rgba(0, 180, 216, 0.08) !important;
}

/* ── Subtle ambient glow on the main content area ── */
.main-content::before {
  content: '' !important;
  position: absolute !important;
  top: -200px !important;
  right: -200px !important;
  width: 500px !important;
  height: 500px !important;
  background: radial-gradient(circle, rgba(0, 180, 216, 0.04) 0%, transparent 70%) !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* ── Scrollbar — cyan accent ── */
::-webkit-scrollbar-thumb {
  background: rgba(0, 180, 216, 0.2) !important;
  border-radius: 4px !important;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 180, 216, 0.35) !important;
}

/* ── Coach domain cards ── */
.coach-domain-card {
  border: 1px solid rgba(0, 180, 216, 0.1) !important;
  border-radius: 14px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.coach-domain-card:hover {
  border-color: rgba(0, 180, 216, 0.25) !important;
  box-shadow: 0 4px 24px rgba(0, 180, 216, 0.1) !important;
  transform: translateY(-2px) !important;
}

.coach-domain-card.selected {
  border-color: #00b4d8 !important;
  box-shadow: 0 0 30px rgba(0, 180, 216, 0.2) !important;
}

/* ── Status indicators — pulsing dot ── */
.status-active::before,
.status-online::before {
  content: '' !important;
  display: inline-block !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: #00d4aa !important;
  margin-right: 6px !important;
  box-shadow: 0 0 8px rgba(0, 212, 170, 0.5) !important;
  animation: statusPulse 2s ease-in-out infinite !important;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 212, 170, 0.5); }
  50% { box-shadow: 0 0 16px rgba(0, 212, 170, 0.8); }
}

/* ── Subtle divider lines — cyan tinted ── */
hr, .divider, [class*="divider"] {
  border-color: rgba(0, 180, 216, 0.08) !important;
}

/* ── Badge premium treatment ── */
.badge, .status-badge, .tag {
  border-radius: 8px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* ============================================================
   PREMIUM UX ENGINE v2 — Extended Global Effects
   Appended additively — no existing rules modified
   ============================================================ */

/* ── Button Click Ripple ── */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  animation: rippleExpand 0.65s ease-out forwards;
  pointer-events: none;
  z-index: 100;
}

@keyframes rippleExpand {
  to { transform: scale(5); opacity: 0; }
}

/* ── Status Dot — Warning / Critical Pulse Variants ── */
.status-dot,
.status-indicator,
[class*="-status-dot"],
[class*="status_dot"] {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
}

/* Green — active/online */
.status-dot.active,
.status-dot.online,
.status-dot.success,
[class*="status-dot"].active {
  background: #00d4aa \!important;
  box-shadow: 0 0 8px rgba(0, 212, 170, 0.6) \!important;
  animation: pulseGreen 2s ease-in-out infinite \!important;
}

/* Amber — warning */
.status-dot.warning,
.status-dot.pending,
[class*="status-dot"].warning {
  background: #ffb84d \!important;
  box-shadow: 0 0 8px rgba(255, 184, 77, 0.5) \!important;
  animation: pulseAmber 2s ease-in-out infinite \!important;
}

/* Red — critical/error */
.status-dot.critical,
.status-dot.error,
.status-dot.danger,
.status-dot.overdue,
[class*="status-dot"].critical {
  background: #ff4d6a \!important;
  box-shadow: 0 0 8px rgba(255, 77, 106, 0.6) \!important;
  animation: pulseRed 1.4s ease-in-out infinite \!important;
}

@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 6px rgba(0, 212, 170, 0.5); transform: scale(1); }
  50%       { box-shadow: 0 0 16px rgba(0, 212, 170, 0.9); transform: scale(1.18); }
}
@keyframes pulseAmber {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 184, 77, 0.4); transform: scale(1); }
  50%       { box-shadow: 0 0 16px rgba(255, 184, 77, 0.9); transform: scale(1.18); }
}
@keyframes pulseRed {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 77, 106, 0.5); transform: scale(1); }
  50%       { box-shadow: 0 0 20px rgba(255, 77, 106, 1); transform: scale(1.22); }
}

/* ── Ambient Grain Noise Texture (subtle) ── */
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.022;
  animation: grainDrift 0.12s steps(1) infinite;
}

@keyframes grainDrift {
  0%  { transform: translate(0,    0);    }
  12% { transform: translate(-2px, -2px); }
  25% { transform: translate(2px,  -1px); }
  37% { transform: translate(-1px,  2px); }
  50% { transform: translate(1px,   1px); }
  62% { transform: translate(-2px,  1px); }
  75% { transform: translate(2px,   2px); }
  87% { transform: translate(-1px, -2px); }
}

/* ── Table Row Glow ── */
tbody tr {
  transition: background 0.18s ease, box-shadow 0.18s ease \!important;
}
tbody tr:hover {
  background: rgba(0, 180, 216, 0.045) \!important;
  box-shadow: inset 0 0 0 1px rgba(0, 180, 216, 0.07) \!important;
}

/* ── List Item Lift on Hover ── */
.list-item,
.list-row,
[class*="list-item"],
[class*="list-row"] {
  transition: transform 0.2s var(--ease-out-expo), background 0.2s ease \!important;
}
.list-item:hover,
.list-row:hover,
[class*="list-item"]:hover,
[class*="list-row"]:hover {
  transform: translateX(4px) \!important;
  background: rgba(0, 180, 216, 0.04) \!important;
}

/* ── Nav Item — underline slide on hover ── */
/* Note: .nav-item already has active::after — add hover bottom line */
.nav-item::after {
  /* Override the active accent bar ONLY for non-active hover state */
  /* This adds a subtle underline sweep on hover for non-active items */
}
.nav-item:not(.active)::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 180, 216, 0.5), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-out-expo);
  border-radius: 0;
  box-shadow: none;
  animation: none;
  top: auto;
  width: auto;
}
.nav-item:not(.active):hover::after {
  transform: scaleX(1);
}

/* ── Staggered entry via CSS (any .stagger-grid container) ── */
.stagger-grid > *,
.cc-3col > *,
.cc-2col > *,
.stats-grid .stat-card {
  animation-fill-mode: both;
}

/* ── Expanded card hover — includes module-specific cards ── */
.pipeline-card:hover,
.follow-up-card:hover,
.patient-card:hover,
.consult-card:hover,
.staff-card:hover,
.revenue-card:hover,
.health-card:hover,
.schedule-card:hover,
.mc-card:hover,
.cc-kpi-card:hover {
  border-color: rgba(0, 180, 216, 0.22) \!important;
  box-shadow: 0 8px 40px rgba(0, 180, 216, 0.1), 0 0 0 1px rgba(0, 180, 216, 0.08) \!important;
  transform: translateY(-2px) \!important;
  transition: all 0.3s var(--ease-out-expo) \!important;
}

/* ── Progress Bar Animated Fill ── */
.progress-fill,
progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan), var(--accent-blue)) \!important;
  background-size: 200% 100% \!important;
  animation: progressShine 2.5s ease-in-out infinite \!important;
}
@keyframes progressShine {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Bottom ambient violet glow ── */
.main-content::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 250px;
  right: 0;
  height: 35%;
  background: radial-gradient(ellipse 70% 50% at 60% 100%, rgba(124, 58, 237, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Mobile: reduce/disable heavy effects ── */
@media (max-width: 768px) {
  body::after {
    animation: none \!important;
    opacity: 0.01 \!important;
  }
  .main-content::after {
    display: none \!important;
  }
}

/* ── Reduced Motion: disable new animations ── */
@media (prefers-reduced-motion: reduce) {
  body::after,
  .status-dot,
  .status-dot.active,
  .status-dot.warning,
  .status-dot.critical,
  .btn-ripple,
  .progress-fill {
    animation: none \!important;
  }
  .nav-item:not(.active)::after {
    transition: none \!important;
  }
}
