* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent !important;
}

*:focus,
*:active {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

#mobile-floating-summary-container,
.island-pill-header,
.island-expanded-body,
.glass-summary-pill,
.glass-summary-expanded,
button,
.milestone-card {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  outline: none !important;
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.sync-dot.online {
  background: #059669 !important;
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.9) !important;
}

.sync-dot.offline {
  background: #dc2626 !important;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.9) !important;
}

:root {
  --font-primary: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  
  /* Tactile Skeuomorphic Light Palette */
  --bg-dark: #dde3ef; /* Soft silver-clay base */
  --bg-panel: #e4e9f2; /* Elevated tactile plate */
  --border-glass: rgba(148, 168, 200, 0.35); /* Soft border bevel */
  --border-glass-light: rgba(148, 168, 200, 0.55);
  
  /* Clean Single-Direction Shadows — no white highlights */
  --shadow-outset: 4px 4px 10px rgba(160, 174, 198, 0.6);
  --shadow-inset: inset 3px 3px 7px rgba(140, 156, 184, 0.5);
  --shadow-inset-deep: inset 4px 4px 10px rgba(120, 140, 170, 0.55);
  --shadow-card-hover: 6px 6px 14px rgba(140, 158, 192, 0.65);
  
  /* Vibrant Accent Colors */
  --accent-blue: #2563eb;   /* Royal Blue */
  --accent-cyan: #0284c7;   /* Sky Blue */
  --accent-green: #059669;  /* Emerald */
  --accent-purple: #7c3aed; /* Vivid Violet */
  
  /* Text Styling for High Readability */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -ms-overflow-style: none !important;  /* IE and Edge */
  scrollbar-width: none !important;  /* Firefox */
}

*::-webkit-scrollbar {
  display: none !important;  /* Chrome, Safari and Opera */
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* 🪐 Luxurious Background Ambient Lights */
.glow-orb { display: none !important; }
.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-blue) 0%, transparent 80%);
  top: -150px;
  right: -50px;
}
.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 80%);
  bottom: -200px;
  left: -100px;
}
.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-green) 0%, transparent 80%);
  top: 30%;
  left: 25%;
  opacity: 0.08;
}

/* 🏢 Central Layout Wrapper */
.app-container {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px;
  min-height: 0;
}

/* 🏷️ Premium Header Bar */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: var(--bg-panel);
  border: 1px solid var(--border-glass-light);
  border-radius: 16px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-outset);
  position: sticky;
  top: 14px;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  font-size: 32px;
  color: var(--accent-cyan);
  filter: drop-shadow(0 2px 10px rgba(0, 242, 254, 0.2));
}

.brand-text h1 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.brand-text p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

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

/* 🔍 Crisp Search Slot */
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-dark);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0 14px;
  height: 40px;
  box-shadow: var(--shadow-inset);
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--border-glass-light);
  box-shadow: 0 0 12px rgba(15, 23, 42, 0.05);
}

.search-box span {
  color: var(--text-secondary);
  font-size: 18px;
  margin-right: 8px;
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-primary);
  font-size: 13.5px;
  width: 170px;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-box input:focus {
  width: 220px;
}

/* 🟢 LED Heartbeat Badges */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 245, 160, 0.03);
  border: 1px solid rgba(0, 245, 160, 0.15);
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-green);
}

.status-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.status-indicator.offline {
  background: rgba(239, 68, 68, 0.03);
  border-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.status-indicator.offline .dot {
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

/* 🎛️ Dual Column Workspace Grid */
.workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
}

/* 🧭 Sidebar Menu */
.sidebar {
  background: var(--bg-panel); box-shadow: var(--shadow-outset); backdrop-filter: none; -webkit-backdrop-filter: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 40px var(--input-bg);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  outline: none;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-item:hover {
  color: #fff;
  background: var(--bg-dark); box-shadow: var(--shadow-inset);
}

.nav-item.active {
  color: #fff;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 6px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.04);
}

.sidebar-footer span {
  color: var(--text-muted);
  font-size: 16px;
}

.sidebar-footer p {
  font-size: 11px;
  color: var(--text-muted);
}

/* 🖼️ Premium Frosted Panel Cards */
.content-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  min-width: 0;
  width: 100%;
}

.tab-content.active {
  display: block;
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.glass-card {
  background: var(--bg-panel); box-shadow: var(--shadow-outset); backdrop-filter: none; -webkit-backdrop-filter: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 10px 40px var(--input-bg);
  transition: all 0.25s ease;
}

.glass-card:hover {
  background: var(--bg-panel-hover);
  border-color: var(--border-glass);
}

.glass-card.full-width {
  grid-column: span 2;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg-dark); box-shadow: var(--shadow-inset);
  border: 1px solid var(--border-glass);
}

.card-avatar.bse-color { color: var(--accent-cyan); background: rgba(0, 242, 254, 0.04); }
.card-avatar.mcx-color { color: var(--accent-green); background: rgba(0, 245, 160, 0.04); }
.card-avatar.nse-color { color: var(--accent-purple); background: rgba(157, 78, 221, 0.04); }
.card-avatar.backoffice-color { color: #f97316; background: rgba(249, 115, 22, 0.04); }
.card-avatar.email-color { color: #eab308; background: rgba(234, 179, 8, 0.04); }
.card-avatar.db-color { color: #06b6d4; background: rgba(6, 182, 212, 0.04); }

.card-title h2 {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-title p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* 📋 Refined Form Elements */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row.three-cols {
  grid-template-columns: repeat(3, 1fr);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.config-input {
  width: 100%;
  height: 44px;
  background: var(--bg-dark);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 13.5px;
  outline: none;
  box-shadow: var(--shadow-inset);
  transition: all 0.2s ease;
}

.config-input:focus {
  border-color: var(--border-glass-light);
  background: var(--bg-dark);
  box-shadow: var(--shadow-inset-deep);
}

.input-wrapper button {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.input-wrapper button:hover {
  color: #fff;
  background: var(--bg-dark);
}

.input-wrapper .btn-toggle-pass { right: 10px; }
.input-wrapper .btn-copy { right: 38px; }

.input-wrapper:has(.btn-copy) .config-input {
  width: 100%;
  height: 44px;
  background: var(--bg-dark);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 13.5px;
  outline: none;
  box-shadow: var(--shadow-inset);
  transition: all 0.2s ease;
}
.input-wrapper:has(.btn-toggle-pass):not(:has(.btn-copy)) .config-input {
  width: 100%;
  height: 44px;
  background: var(--bg-dark);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 13.5px;
  outline: none;
  box-shadow: var(--shadow-inset);
  transition: all 0.2s ease;
}

/* 🎛️ Dynamic Backoffice Cards */
.backoffice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.backoffice-item {
  background: var(--inner-bg);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
}

.backoffice-item:hover {
  background: var(--input-bg);
  border-color: var(--border-glass);
}

.backoffice-header {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.03);
}

/* 📂 Smooth Email Accordions */
.accordion-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accordion-item {
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  background: var(--inner-bg);
  overflow: hidden;
  transition: all 0.2s ease;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}

.accordion-header:hover {
  background: rgba(15, 23, 42, 0.01);
}

.accordion-header .title-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-header .title-block h3 {
  font-size: 14px;
  color: var(--text-primary);
}

.accordion-header .title-block span {
  color: var(--accent-green);
  font-size: 11.5px;
  font-weight: 500;
}

.accordion-header .expand-icon {
  font-size: 20px;
  color: var(--text-secondary);
  transition: transform 0.25s ease;
}

.accordion-item.open {
  border-color: var(--border-glass);
  background: var(--inner-bg);
}

.accordion-item.open .accordion-header .expand-icon {
  transform: rotate(180deg);
  color: #fff;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 20px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.accordion-item.open .accordion-content {
  max-height: 1200px;
  padding-bottom: 20px;
}

/* 🔘 Neumorphic Secondary Buttons */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  white-space: nowrap;
  background: var(--bg-panel);
  border: 1px solid var(--border-glass) !important;
  color: var(--text-secondary) !important;
  border-radius: 10px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-outset);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover {
  background: rgba(15, 23, 42, 0.05);
  border-color: var(--border-glass-light) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-card-hover);
}

.btn-secondary:active {
  background: var(--bg-dark);
  box-shadow: var(--shadow-inset) !important;
  transform: scale(0.97);
}

.btn-secondary span.material-icons-round {
  font-size: 18px;
  color: var(--text-secondary);
}

.btn-secondary:hover span.material-icons-round {
  color: var(--text-primary);
}

/* 🔘 Clean Frosted Action Buttons */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  background: linear-gradient(135deg, #1e40af 0%, #0369a1 100%) !important;
  border: 1px solid var(--border-glass-light) !important;
  color: #ffffff !important;
  box-shadow: var(--shadow-outset) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-submit:hover {
  background: linear-gradient(180deg, var(--border-glass-light) 0%, rgba(15, 23, 42, 0.04) 100%);
  border-color: var(--border-glass-light);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transform: translateY(-0.5px);
}

.btn-submit:active {
  transform: translateY(0.5px);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.03) 0%, rgba(15, 23, 42, 0.01) 100%);
  box-shadow: inset 0 1px 2px var(--inner-bg);
}

/* Colored Accents specifically for Save Buttons to look outstanding */
#form-bse .btn-submit,
#form-nse-api .btn-submit,
#form-database .btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  background: linear-gradient(135deg, #1e40af 0%, #0369a1 100%) !important;
  border: 1px solid var(--border-glass-light) !important;
  color: #ffffff !important;
  box-shadow: var(--shadow-outset) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#form-bse .btn-submit:hover,
#form-nse-api .btn-submit:hover,
#form-database .btn-submit:hover {
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 6px 16px rgba(0, 242, 254, 0.15);
}

#form-mcx .btn-submit,
#form-backoffice .btn-submit,
#form-email .btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  background: linear-gradient(135deg, #1e40af 0%, #0369a1 100%) !important;
  border: 1px solid var(--border-glass-light) !important;
  color: #ffffff !important;
  box-shadow: var(--shadow-outset) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#form-mcx .btn-submit:hover,
#form-backoffice .btn-submit:hover,
#form-email .btn-submit:hover {
  border-color: rgba(0, 245, 160, 0.4);
  box-shadow: 0 6px 16px rgba(0, 245, 160, 0.15);
}

.margin-top-md {
  margin-top: 20px;
}

.margin-bottom-md {
  margin-bottom: 20px;
}

/* 🌀 Spinner & Loader */
.loading-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  width: 100%;
  grid-column: span 3;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(15, 23, 42, 0.05);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

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

.loading-placeholder p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 🔔 Elegant Floating Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-glass-light);
  color: var(--text-primary);
  box-shadow: var(--shadow-outset);
  min-width: 300px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.success span.icon { color: var(--accent-green); }

.toast.error { border-left: 3px solid #ef4444; }
.toast.error span.icon { color: #ef4444; }

.toast.info { border-left: 3px solid var(--accent-cyan); }
.toast.info span.icon { color: var(--accent-cyan); }

.toast span.icon {
  font-size: 20px;
}

.toast .toast-text h4 {
  font-size: 13.5px;
  font-weight: 600;
}

.toast .toast-text p {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* 🏷️ Clean Footer styling */
.app-footer {
  text-align: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 16px;
}

.hidden-card {
  display: none !important;
}

/* 🔐 Crisp Glassmorphic Auth Overlay */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--overlay-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  margin: 16px;
  background: var(--bg-panel); box-shadow: var(--shadow-outset); backdrop-filter: none; -webkit-backdrop-filter: none;
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: authFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  font-size: 44px;
  color: var(--accent-cyan);
  filter: drop-shadow(0 2px 10px rgba(0, 242, 254, 0.2));
  margin-bottom: 8px;
}

.auth-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.auth-header p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.auth-input {
  padding-left: 42px !important;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  font-size: 18px;
  pointer-events: none;
}

.input-wrapper:focus-within .input-icon {
  color: #fff;
}

.auth-btn {
  height: 44px;
  font-size: 14px;
  margin-top: 8px;
}

.client-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.2);
  padding: 0 14px;
  height: 40px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-cyan);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.client-badge:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.35);
  transform: translateY(-1px);
}

.client-badge span.material-icons-round {
  font-size: 18px;
}

.btn-logout {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  margin: 0;
  box-shadow: var(--shadow-outset);
}

/* Online LED state for Logout button */
.btn-logout.online,
.btn-logout:not(.offline) {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.btn-logout.online:hover,
.btn-logout:not(.offline):hover {
  background: #10b981;
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

/* Offline LED state for Logout button */
.btn-logout.offline {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.btn-logout.offline:hover {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-logout span.material-icons-round {
  font-size: 20px;
}

/* Mobile & Desktop Header Visibility Controls */
@media (min-width: 769px) {
  .mobile-header-actions {
    display: none !important;
  }
  .desktop-logout-btn {
    display: flex !important;
  }
  .desktop-client-dot {
    display: inline-block !important;
  }
}

@media (max-width: 768px) {
  .brand {
    width: 100% !important;
    min-width: 0 !important;
  }
  .brand-text {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 !important;
  }
  .desktop-logout-btn {
    display: none !important;
  }
  .desktop-client-dot {
    display: none !important;
  }
  .mobile-header-actions {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }
  .mobile-logout-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .mobile-logout-btn span {
    font-size: 18px;
  }
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.05); opacity: 1; }
}

/* ======================================================================
   📱 RESPONSIVE & LAYOUT LOCK SYSTEM
   ====================================================================== */

@media (min-width: 1024px) {
  body {
    height: 100vh;
    overflow: hidden;
  }
  
  .app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
    overflow: hidden;
  }
  
  .main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: var(--bg-panel);
  border: 1px solid var(--border-glass-light);
  border-radius: 16px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-outset);
  position: sticky;
  top: 14px;
  z-index: 1000;
}
  
  .workspace {
    flex: 1;
    min-height: 0;
    height: calc(100% - 100px); /* fallback */
    align-items: stretch;
    gap: 24px;
  }
  
  .sidebar {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
  }
  
  .sidebar::-webkit-scrollbar {
    display: none;
  }
  
  .content-panel {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    padding-right: 4px;
  }
  
  .content-panel::-webkit-scrollbar {
    display: none;
  }
  
  .app-footer {
    flex: none;
    padding: 8px 0 0;
    margin-top: 12px;
  }
}

@media (max-width: 1023px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  
  .sidebar {
    margin-bottom: 20px;
  }
  
  .main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: var(--bg-panel);
    border: 1px solid var(--border-glass-light);
    border-radius: 16px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-outset);
    position: sticky;
    top: 14px;
    z-index: 1000;
  }
  
  .header-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .search-box input {
    width: 100% !important;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 12px 10px;
  }

  .main-header {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 12px;
    position: static !important;
    margin-bottom: 16px;
  }

  .header-controls {
    flex-direction: column !important;
    align-items: stretch;
    gap: 10px;
  }

  .header-controls .search-box {
    width: 100% !important;
  }

  .header-controls .search-box input {
    width: 100% !important;
  }

  /* Inline controls container for badges & logout on mobile */
  .header-controls > *:not(.search-box) {
    margin-right: 0;
  }

  /* Stack status, badge and buttons in a flexible row */
  .header-controls {
    display: flex;
    flex-direction: column;
  }
  
  .header-controls .client-badge {
    justify-content: center;
    width: 100%;
  }

  .header-controls .status-indicator {
    justify-content: center;
    width: 100%;
  }

  .sidebar {
    padding: 6px 10px;
    flex-direction: row !important;
    overflow-x: auto !important;
    white-space: nowrap;
    border-radius: 12px;
    margin-bottom: 16px;
    gap: 6px;
  }

  .nav-menu {
    flex-direction: row !important;
    overflow-x: auto !important;
    width: 100%;
    scrollbar-width: none !important;
    gap: 8px;
  }

  .nav-menu::-webkit-scrollbar {
    display: none !important;
  }

  .nav-item {
    padding: 8px 14px;
    width: auto !important;
    flex-shrink: 0;
  }

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

  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .glass-card {
    grid-column: span 1 !important;
    padding: 16px 14px !important;
    max-width: 100% !important;
  }
  
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  
  .backoffice-grid {
    grid-template-columns: 1fr;
  }

  .auth-overlay {
    align-items: flex-start !important;
    overflow-y: auto !important;
    padding: 20px 10px !important;
  }

  .auth-card {
    margin: 0 auto !important;
    padding: 20px 16px !important;
    max-width: 100% !important;
  }
}

/* 🎭 Premium Role Selector in Login Card */
.role-selector-container {
  display: flex;
  background: var(--bg-dark);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--shadow-inset);
  margin-top: 6px;
  margin-bottom: 4px;
}

.role-tab-btn {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.role-tab-btn:hover {
  color: #fff;
}

.role-tab-btn.active {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-glass) !important;
  color: var(--text-primary) !important;
  font-weight: 600;
  box-shadow: var(--shadow-outset) !important;
}


/* ======================================================================
   🔌 SKEUOMORPHIC TRACKER & EXECUTION REGISTRY STYLES
   ====================================================================== */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-outset);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  user-select: none;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.metric-card:active {
  transform: scale(0.97);
}

.metric-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.metric-info h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.metric-info p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

.icon-total { background: rgba(0, 136, 255, 0.1); color: var(--accent-cyan); border: 1px solid rgba(0, 242, 254, 0.2); }
.icon-failed { background: rgba(239, 68, 68, 0.1); color: #ff4d4d; border: 1px solid rgba(239, 68, 68, 0.2); }
.icon-running { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.icon-resolved { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.2); }

.filter-bar {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-outset);
}

.filter-inputs {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-actions {
  display: flex;
  gap: 12px;
}

.runs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.run-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-outset);
}

.run-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: background-color 0.3s ease;
}

.run-card.status-success::before { background: var(--accent-green); }
.run-card.status-failed::before { background: #ff4d4d; }
.run-card.status-stopped::before { background: #ff4d4d; }
.run-card.status-running::before { background: #f59e0b; }
.run-card.status-resolved::before { background: var(--accent-blue); }

.status-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
}
.status-badge.badge-success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-green);
}
.status-badge.badge-failed {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ff5b5b;
}
.status-badge.badge-running {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f59e0b;
}
.status-badge.badge-waiting {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}
.status-badge.badge-resolved {
  background: rgba(0, 136, 255, 0.08);
  border: 1px solid rgba(0, 136, 255, 0.25);
  color: var(--accent-blue);
}


.run-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.run-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.run-client-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.run-client-id {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: monospace;
  margin-top: 2px;
}

.run-date {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.run-details-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.run-detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.run-detail-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.run-detail-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.error-count-badge {
  background: #fee2e2;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ff4d4d;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Modals overlays & accordion additions */
.drawer-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-dark);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

.drawer-tab-btn {
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-tab-btn.active {
  background: var(--bg-panel);
  color: var(--text-primary);
  box-shadow: var(--shadow-outset);
  border: 1px solid var(--border-glass);
}

.log-file-tag {
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid var(--border-glass);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-cyan);
}

.log-file-tag:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
}

/* Error stack cards in list */
.error-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-outset);
  transition: all 0.2s ease;
}

.error-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.log-error-line {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ff4d4d;
  padding-left: 6px;
  display: block;
  font-weight: 500;
  word-break: break-all;
}

.resolution-textarea {
  width: 100%;
  height: 80px;
  background: var(--bg-dark);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 12px;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 13px;
  resize: none;
  outline: none;
  box-shadow: var(--shadow-inset);
  transition: all 0.2s ease;
}

.resolution-textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-inset-deep);
}

.gallery-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-outset);
  transition: all 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-card-hover);
}

/* Responsive adjustment for two columns split in Activity */
@media (max-width: 1023px) {
  .drawer-split-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  .drawer-split-container[style*="display: none"],
  .drawer-split-container[style*="display:none"] {
    display: none !important;
  }
}

/* 🔒 Restricted Client Mode Workspace layout - unhidden sidebar for client run card toggler */
@media (min-width: 1024px) {
  .workspace.client-mode {
    grid-template-columns: 240px minmax(0, 1fr) !important;
  }
}

@media (max-width: 1023px) {
  .workspace.client-mode {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

.workspace.client-mode .sidebar {
  display: flex !important;
}

/* ======================================================================
   🎯 PROCESS MILESTONE TRACKER DASHBOARD STYLES
   ====================================================================== */

/* Tab selection styling */
.btn-tab-toggle {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-tab-toggle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.btn-tab-toggle.active {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-glass-light) !important;
  box-shadow: var(--shadow-outset) !important;
}

.milestone-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px 16px 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: justify;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-outset);
}

.milestone-card::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 8px;
  width: 4px;
  height: calc(100% - 28px);
  border-radius: 10px;
  background: transparent;
  transition: background-color 0.2s ease;
}

.milestone-card.active {
  background: var(--bg-hover);
  border-color: rgba(0, 242, 254, 0.25);
  box-shadow: var(--shadow-card-hover);
}

.milestone-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

/* Status colors and side accent bars */
.milestone-card.status-done::before { background: var(--accent-green); }
.milestone-card.status-in_progress::before { background: #f59e0b; }
.milestone-card.status-pending::before { background: var(--text-muted); }

.milestone-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.milestone-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  flex: 1;
}

.milestone-time {
  font-size: 10.5px;
  color: var(--text-secondary);
  font-family: monospace;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* File Check Status Badges */
.badge-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-found {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-green);
}

.badge-missing {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ff5b5b;
}

.badge-waiting {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.badge-in_progress {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f59e0b;
}

/* Expected Files Table */
.file-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  table-layout: fixed;
}

.file-table th, .file-table td {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  border-bottom: 1px solid var(--border-glass-light);
}

.file-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.01);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-table th:nth-child(1), .file-table td:nth-child(1) { width: 25%; }
.file-table th:nth-child(2), .file-table td:nth-child(2) { width: 35%; }
.file-table th:nth-child(3), .file-table td:nth-child(3) { width: 20%; }
.file-table th:nth-child(4), .file-table td:nth-child(4) { width: 20%; }

.file-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.file-table td.file-name-col {
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
}

.file-table td.file-pattern-col {
  font-family: monospace;
  color: var(--text-secondary);
  font-size: 11px;
  word-break: break-all;
  white-space: normal;
}

.file-table td.file-folder-col {
  color: var(--text-muted);
  font-size: 11px;
  word-break: break-all;
  white-space: normal;
}

/* Mobile responsive adjustments for Milestone Tracker */
@media (max-width: 768px) {
  #tracker-dashboard-container {
    grid-template-columns: 1fr !important;
  }
  #milestone-details-panel {
    display: none !important;
  }
}

/* Custom beautiful scrollbar for scrollable panels */
#tracker-milestones-list::-webkit-scrollbar,
#detail-errors-list::-webkit-scrollbar,
#milestone-files-table-container::-webkit-scrollbar,
.content-panel::-webkit-scrollbar,
#logs-modal-scroll::-webkit-scrollbar {
  display: block !important;
  width: 6px !important;
  height: 6px !important;
}

#tracker-milestones-list::-webkit-scrollbar-thumb,
#detail-errors-list::-webkit-scrollbar-thumb,
#milestone-files-table-container::-webkit-scrollbar-thumb,
.content-panel::-webkit-scrollbar-thumb,
#logs-modal-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 168, 200, 0.4) !important;
  border-radius: 10px !important;
}

#tracker-milestones-list::-webkit-scrollbar-track,
#detail-errors-list::-webkit-scrollbar-track,
#milestone-files-table-container::-webkit-scrollbar-track,
.content-panel::-webkit-scrollbar-track,
#logs-modal-scroll::-webkit-scrollbar-track {
  background: transparent !important;
}

@media (min-width: 1024px) {
  /* Left panel container sticky & flex layout */
  #tracker-dashboard-container > div:first-child {
    position: sticky;
    top: 110px;
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
  }
  
  #tracker-milestones-list {
    flex: 1;
    overflow-y: auto;
  }

  /* Right panel container sticky layout (standard block rendering inside) */
  #milestone-details-panel {
    position: sticky;
    top: 110px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
}

/* Custom scrollbar for sticky milestone details panel */
#milestone-details-panel::-webkit-scrollbar {
  display: block !important;
  width: 6px !important;
  height: 6px !important;
}

#milestone-details-panel::-webkit-scrollbar-thumb {
  background: rgba(148, 168, 200, 0.4) !important;
  border-radius: 10px !important;
}

#milestone-details-panel::-webkit-scrollbar-track {
  background: transparent !important;
}

@keyframes islandDropDownFromTop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-60px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* ======================================================================
   📱 60FPS FLUID DYNAMIC ISLAND GLASSMORPHISM FOR MOBILE OVERVIEW
   ====================================================================== */
@media (max-width: 768px) {
  #sidebar-run-summary-container {
    display: none !important;
  }

  #mobile-floating-summary-container {
    position: fixed !important;
    top: 68px !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(0) scale(1) !important;
    z-index: 99999 !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(18px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(180%) !important;
    border: none !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    animation: islandDropDownFromTop 0.55s cubic-bezier(0.16, 1, 0.3, 1) ease-out !important;
    will-change: width, max-height, border-radius, padding, opacity, transform !important;
    transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                border-radius 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .island-pill-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    gap: 8px !important;
    transition: opacity 0.25s ease, transform 0.25s ease !important;
  }

  .island-expanded-body {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    transition: opacity 0.3s ease 0.05s, transform 0.3s ease 0.05s !important;
  }

  /* Collapsed Pill Mode */
  #mobile-floating-summary-container.island-collapsed {
    width: 250px !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 40px !important;
    border-radius: 30px !important;
    padding: 7px 14px !important;
  }

  #mobile-floating-summary-container.island-collapsed .island-pill-header {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }

  #mobile-floating-summary-container.island-collapsed .island-expanded-body {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-10px) !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  /* Expanded Details Mode */
  #mobile-floating-summary-container.island-expanded {
    width: 315px !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 250px !important;
    border-radius: 22px !important;
    padding: 16px 18px !important;
  }

  #mobile-floating-summary-container.island-expanded .island-pill-header {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-10px) !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  #mobile-floating-summary-container.island-expanded .island-expanded-body {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
    height: auto !important;
  }

  /* Smoothly slide UP into top header when ANY modal popup is open or explicitly hidden */
  body:has(#milestone-modal:not([style*="display: none"])) #mobile-floating-summary-container,
  body:has(#logs-modal:not([style*="display: none"])) #mobile-floating-summary-container,
  body:has(#gallery-modal:not([style*="display: none"])) #mobile-floating-summary-container,
  body:has(#single-image-modal:not([style*="display: none"])) #mobile-floating-summary-container,
  body:has(#lightbox-modal:not([style*="display: none"])) #mobile-floating-summary-container,
  body:has(#modal-resolve-error:not([style*="display: none"])) #mobile-floating-summary-container,
  body:has(#resolve-modal:not([style*="display: none"])) #mobile-floating-summary-container,
  body.modal-open #mobile-floating-summary-container,
  #mobile-floating-summary-container.island-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(-50%) translateY(-60px) scale(0.92) !important;
    animation: none !important;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  /* Slide Left Dismissal */
  #mobile-floating-summary-container.island-dismiss-left {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(-180%) translateY(0) scale(0.85) !important;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  /* Slide Right Dismissal */
  #mobile-floating-summary-container.island-dismiss-right {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(180%) translateY(0) scale(0.85) !important;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
}

@media (min-width: 769px) {
  #mobile-floating-summary-container {
    display: none !important;
  }
}
