/* ==========================================================================
   SPREADSHEET AUTOBOT PREMIUM CSS STYLING
   Aesthetics: Deep Space Dark Mode, Glassmorphism, Neon Highlights
   ========================================================================== */

/* Variables & Theme Tokens */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-title: 'Outfit', var(--font-sans);
  
  /* Color Palette */
  --bg-main: #060913;
  --bg-card: rgba(13, 20, 38, 0.45);
  --bg-card-hover: rgba(20, 30, 56, 0.55);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --color-primary: #6366f1; /* Indigo */
  --color-primary-glow: rgba(99, 102, 241, 0.35);
  --color-secondary: #a855f7; /* Purple */
  
  /* Status Colors */
  --color-success: #10b981; /* Emerald */
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-success-border: rgba(16, 185, 129, 0.25);
  --color-error: #ef4444; /* Red */
  --color-error-bg: rgba(239, 68, 68, 0.12);
  --color-error-border: rgba(239, 68, 68, 0.25);
  --color-warning: #f59e0b; /* Amber */
  --color-info: #06b6d4; /* Cyan */
  
  /* Text */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-darker: #6b7280;
  
  /* Shadows */
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 20px 0 var(--color-primary-glow);
}

/* Reset & Base Settings */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Deep Space Background Glow Spheres */
.glow-bg {
  position: fixed;
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.25;
}

.glow-purple {
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--color-secondary) 0%, rgba(0,0,0,0) 70%);
  top: -10%;
  right: -5%;
}

.glow-blue {
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--color-primary) 0%, rgba(0,0,0,0) 70%);
  bottom: -15%;
  left: -10%;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Container */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

/* Glassmorphism Helper Classes */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-glass);
}

/* Cards */
.card {
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--bg-card-hover);
}

.card-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.title-icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
}

/* Header Component */
.app-header {
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pulse-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  position: relative;
}

.logo-icon {
  width: 26px;
  height: 26px;
  color: white;
}

.app-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #d8b4fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.server-time {
  font-size: 0.75rem;
  color: var(--text-darker);
  font-family: monospace;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.badge-active {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}
.badge-active .status-dot {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-glowing 2s infinite;
}

.badge-paused {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}
.badge-paused .status-dot {
  background: #f59e0b;
}

.badge-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}
.badge-error .status-dot {
  background: #ef4444;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
  min-width: 0; /* Prevents grid tracks from overflowing */
}

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

/* LEFT COLUMN - CONFIGURATIONS PANEL */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Setup Wizard Form */
.wizard-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.form-group input, 
.glass-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.form-group input:focus,
.glass-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.cron-input-group {
  display: flex;
  gap: 10px;
}

.cron-input-group input {
  flex: 1;
}

.glass-select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: #0d1426;
  color: var(--text-main);
  font-size: 0.8rem;
  max-width: 160px;
  outline: none;
  cursor: pointer;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-darker);
  margin-top: 4px;
  display: block;
}

/* Accordion Component */
.accordion {
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 20px;
}

.accordion-header {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.accordion-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.accordion-header.active .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 16px 14px;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-glass);
}

.wizard-help-box {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 16px;
}

.wizard-help-box strong {
  font-size: 0.8rem;
  color: var(--color-primary);
  display: block;
  margin-bottom: 6px;
}

.wizard-help-box ol {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: 16px;
}

.wizard-help-box li {
  margin-bottom: 4px;
}

.wizard-help-box a {
  color: var(--color-info);
  text-decoration: none;
}
.wizard-help-box a:hover {
  text-decoration: underline;
}

.selectable {
  font-family: monospace;
  background: rgba(255,255,255,0.06);
  padding: 2px 4px;
  border-radius: 4px;
  user-select: all;
  -webkit-user-select: all;
  border: 1px solid rgba(255,255,255,0.04);
}

/* Button Classes */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
}

.btn-full {
  width: 100%;
}

.btn-half {
  width: calc(50% - 6px);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.btn-outline:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: #ef4444;
}

.btn-glowing {
  background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 100%);
  color: white;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.btn-glowing:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.5);
  filter: brightness(1.1);
}

.btn.disabled,
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* Spinner Rotate Keyframes */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner-icon {
  animation: spin 1s linear infinite;
}

/* Connected Panel UI */
.success-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.success-badge-icon {
  width: 32px;
  height: 32px;
  color: var(--color-success);
}

.banner-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: #34d399;
}

.banner-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auth-details-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.1);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  gap: 20px;
}

.detail-label {
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.detail-val {
  font-family: monospace;
  color: var(--text-main);
  background: rgba(255,255,255,0.03);
  padding: 2px 6px;
  border-radius: 4px;
}

.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Timeline Components */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.timeline-item {
  display: flex;
  gap: 12px;
  position: relative;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  width: 2px;
  height: calc(100% + 14px);
  background: rgba(255, 255, 255, 0.05);
  left: 11px;
  top: 24px;
  z-index: 0;
}

.timeline-node {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.node-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid var(--color-success);
  color: var(--color-success);
}

.node-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1.5px solid var(--color-error);
  color: var(--color-error);
}

.node-icon {
  width: 12px;
  height: 12px;
}

.timeline-content {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  padding: 10px 12px;
  border-radius: 10px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.timeline-status {
  font-size: 0.8rem;
  font-weight: 600;
}

.status-success {
  color: #34d399;
}

.status-error {
  color: #f87171;
}

.timeline-time {
  font-size: 0.7rem;
  color: var(--text-darker);
}

.timeline-body {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-expander {
  background: none;
  border: none;
  color: var(--color-info);
  cursor: pointer;
  text-align: left;
  font-size: 0.7rem;
  margin-top: 4px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 2px;
}

.timeline-expander:hover {
  text-decoration: underline;
}

.error-details-box {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: monospace;
  font-size: 0.7rem;
  color: #fca5a5;
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 100px;
  overflow-y: auto;
}

.main-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0; /* CRITICAL: Prevents CSS grid item from stretching beyond 1fr, forcing table overflow-x scroll */
}

/* Metrics Row */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.metric-card {
  border-radius: 16px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.1);
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 800;
  color: white;
  line-height: 1.1;
}

.metric-value.font-subtitle {
  font-size: 1.05rem;
  font-weight: 700;
}

.metric-icon-bg {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-bg svg {
  width: 22px;
  height: 22px;
}

.bg-cyan {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--color-info);
}

.bg-green {
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success);
}

.bg-purple {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #c084fc;
}

.bg-indigo {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #818cf8;
}

/* Synced Data Explorer */
.table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.table-title-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-darker);
}

.m-0 { margin: 0 !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.mt-5 { margin-top: 40px !important; }

.table-search {
  max-width: 240px;
}

/* Tabs */
.sheet-tabs-container {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 8px;
  overflow-x: auto;
}

.tab-pill {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-pill.active {
  color: white;
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  font-weight: 600;
}

/* Scrollable Table Wrapper */
.table-outer-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.15);
}

.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.825rem;
}

.premium-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.premium-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  white-space: nowrap;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.premium-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

/* Empty State */
.empty-state {
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.empty-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.empty-icon-wrapper svg {
  width: 28px;
  height: 28px;
}

.empty-state h3 {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  color: white;
}

.empty-state p {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 380px;
}

/* Pagination Footer */
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pagination-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

/* REST API Portal Components */
.api-route-bar {
  display: flex;
  align-items: center;
  background: #0d1426;
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  gap: 12px;
}

.method-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  flex-shrink: 0;
}

.method-get {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.api-endpoint-url {
  font-family: monospace;
  font-size: 0.825rem;
  color: var(--text-main);
  flex: 1;
  white-space: nowrap;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

/* Code Explorer sandbox structure */
.code-explorer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .code-explorer-grid {
    grid-template-columns: 1fr;
  }
}

.snippet-section,
.sandbox-section {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  overflow: hidden;
  background: #090e1c;
}

.snippet-header,
.sandbox-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-glass);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.snippet-tabs {
  display: flex;
  gap: 4px;
}

.snippet-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.snippet-tab:hover {
  color: white;
  background: rgba(255,255,255,0.02);
}

.snippet-tab.active {
  color: white;
  background: rgba(255,255,255,0.06);
  font-weight: 600;
}

.code-block,
.sandbox-response {
  padding: 16px;
  font-family: monospace;
  font-size: 0.75rem;
  overflow: auto;
  height: 180px;
  margin: 0;
  color: #38bdf8; /* light blue syntax color */
}

.sandbox-response {
  color: #a7f3d0; /* light green syntax color */
}

/* Toast Messages */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-radius: 10px;
  background: #0f172a;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.5);
  min-width: 320px;
  max-width: 480px;
  animation: slide-in-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-glass);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
}
.toast-success .toast-icon {
  color: var(--color-success);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
}
.toast-error .toast-icon {
  color: var(--color-error);
}

.toast-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
}
.toast-close-btn:hover {
  color: white;
}

.hidden {
  display: none !important;
}

/* App Footer */
.app-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-darker);
  padding: 24px 0 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

/* Animations Keyframes */
@keyframes pulse-glowing {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes slide-in-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Utilities */
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.mt-5 { margin-top: 24px !important; }

/* ==========================================================================
   ADVANCED MOBILE & RESPONSIVE LAYOUT OVERRIDES
   Tailored for flawless display on Tablets and Mobile Devices
   ========================================================================== */

@media (max-width: 768px) {
  /* Main container padding */
  .container {
    padding: 16px 12px;
  }

  /* Compact stacked header */
  .app-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
    gap: 12px;
  }

  .logo-area {
    flex-direction: column;
    gap: 8px;
  }

  .header-status {
    align-items: center;
    width: 100%;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
  }

  /* Dashboard 1-column layout spacing */
  .dashboard-grid {
    gap: 16px;
  }

  /* Compact card paddings */
  .card {
    padding: 16px;
  }

  /* 2x2 sleek Metrics Grid on medium screens */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .metric-card {
    padding: 14px 12px;
    border-radius: 12px;
  }

  .metric-value {
    font-size: 1.25rem;
  }

  .metric-value.font-subtitle {
    font-size: 0.9rem;
  }

  .metric-icon-bg {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .metric-icon-bg svg {
    width: 18px;
    height: 18px;
  }

  /* Table search full-width stretch */
  .table-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .table-search {
    max-width: 100%;
    width: 100%;
  }

  /* Code sandbox blocks scroll margins */
  .code-block,
  .sandbox-response {
    height: 150px;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  /* Smaller Header Typography */
  .app-title {
    font-size: 1.3rem;
  }

  .app-subtitle {
    font-size: 0.75rem;
  }

  .pulse-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .logo-icon {
    width: 22px;
    height: 22px;
  }

  /* Stack Cron preset inputs */
  .cron-input-group {
    flex-direction: column;
    gap: 8px;
  }

  .glass-select {
    max-width: 100%;
    width: 100%;
    font-size: 0.85rem;
  }

  /* Stack Settings Action Buttons */
  .button-row {
    flex-direction: column;
    gap: 10px;
  }

  .btn-half {
    width: 100%;
  }

  /* 1-column metrics on super small screens */
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  /* Swipable scrollbar-free sheet tabs */
  .sheet-tabs-container {
    gap: 4px;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .sheet-tabs-container::-webkit-scrollbar {
    display: none;
  }

  .tab-pill {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  /* Premium scroll indicator for table */
  .table-outer-wrapper {
    border-radius: 8px;
  }

  /* Stack Table Pagination */
  .table-footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    align-items: center;
  }

  .pagination-buttons {
    width: 100%;
    justify-content: center;
  }

  /* REST API code blocks stack */
  .code-explorer-grid {
    gap: 12px;
  }

  /* Toast alerts center bottom */
  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    min-width: 0;
  }
}
