/* ==========================================================================
   SAFRA PAGAMENTOS - MODERN GLASSMORPHIC DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #0f1523;
  --bg-card: rgba(18, 25, 41, 0.72);
  --bg-card-hover: rgba(26, 36, 59, 0.82);
  --bg-glass: rgba(15, 23, 42, 0.65);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(56, 189, 248, 0.3);
  --border-glow: rgba(59, 130, 246, 0.5);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --glow-emerald: 0 0 25px rgba(16, 185, 129, 0.25);
  --glow-cyan: 0 0 25px rgba(6, 182, 212, 0.25);
  --glow-amber: 0 0 25px rgba(245, 158, 11, 0.25);
  --glow-rose: 0 0 25px rgba(244, 63, 94, 0.25);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(139, 92, 246, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Scrollbar moderno */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 13, 20, 0.82);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 50%, #10b981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.35);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.header-status-area {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.portal-status-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.status-dot.emerald { background: var(--accent-emerald); }
.status-dot.emerald::after { border: 2px solid var(--accent-emerald); }

.status-dot.amber { background: var(--accent-amber); }
.status-dot.amber::after { border: 2px solid var(--accent-amber); }

.status-dot.blue { background: var(--accent-cyan); }
.status-dot.blue::after { border: 2px solid var(--accent-cyan); }

.status-dot.purple { background: var(--accent-purple); }
.status-dot.purple::after { border: 2px solid var(--accent-purple); }

.status-dot.rose { background: var(--accent-rose); }
.status-dot.rose::after { border: 2px solid var(--accent-rose); }

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 1.2rem;
  border-left: 1px solid var(--border-subtle);
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-logout:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   MAIN CONTAINER
   ========================================================================== */

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Banner de Alerta de Preempção (Safra Exceção Prioritário) */
.preemption-banner {
  display: none;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.6rem;
  box-shadow: var(--glow-amber);
  animation: slideDown 0.4s ease;
}

.preemption-banner.active {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

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

.preemption-icon {
  font-size: 2rem;
  color: var(--accent-amber);
  animation: pulse-ring 2s infinite;
}

.preemption-text h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 0.2rem;
}

.preemption-text p {
  font-size: 0.85rem;
  color: #fde68a;
  line-height: 1.4;
}

/* ==========================================================================
   METRICS GRID
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.metric-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: var(--transition);
}

.metric-card.card-total::before { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.metric-card.card-liquidado::before { background: linear-gradient(90deg, #10b981, #34d399); }
.metric-card.card-ativo::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.metric-card.card-erros::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.metric-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.metric-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.card-total .metric-icon-badge { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.card-liquidado .metric-icon-badge { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.card-ativo .metric-icon-badge { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.card-erros .metric-icon-badge { background: rgba(244, 63, 94, 0.15); color: #fb7185; }

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metric-sub strong {
  color: #34d399;
}

/* ==========================================================================
   BATCH CONTROL & DISPATCH PANEL
   ========================================================================== */

.dashboard-split {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.5rem;
}

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

.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Mode Switcher Tabs */
.tabs-control {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.25rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab-btn.active {
  background: var(--bg-card-hover);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
}

/* Drag & Drop File Zone */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 2.2rem 1.5rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.3);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.dropzone-icon {
  font-size: 2.5rem;
  color: var(--accent-cyan);
}

.dropzone p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.dropzone p strong {
  color: var(--text-main);
}

.dropzone-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.file-selected-badge {
  display: none;
  align-items: center;
  gap: 0.6rem;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: #38bdf8;
  width: 100%;
}

.file-selected-badge.active {
  display: flex;
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

/* Primary Action Buttons */
.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  color: white;
  border: none;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
  transition: var(--transition);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(6, 182, 212, 0.5);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Batch Active Controls */
.active-batch-controls {
  display: flex;
  gap: 0.6rem;
}

.btn-control {
  flex: 1;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-pause { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.btn-pause:hover { background: rgba(245, 158, 11, 0.25); }

.btn-resume { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.btn-resume:hover { background: rgba(16, 185, 129, 0.25); }

.btn-cancel { background: rgba(244, 63, 94, 0.15); color: #fb7185; border-color: rgba(244, 63, 94, 0.3); }
.btn-cancel:hover { background: rgba(244, 63, 94, 0.25); }

/* ==========================================================================
   PROGRESS & LIVE MONITOR PANEL
   ========================================================================== */

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.status-badge.idle { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }
.status-badge.running { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); animation: pulse-ring 2s infinite; }
.status-badge.paused { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-badge.completed { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-badge.failed { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }

.progress-bar-container {
  width: 100%;
  height: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7, #06b6d4, #10b981);
  border-radius: var(--radius-full);
  transition: width 0.35s ease;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.6);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.progress-meta strong {
  color: var(--text-main);
}

/* Timing & Throughput Metrics Grid */
.timing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.timing-pill {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.timing-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.timing-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

#timerEta {
  color: #38bdf8;
}

#timerSpeed {
  color: #34d399;
}

/* Post-batch action bar */
.post-batch-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
}

.post-batch-bar.active {
  display: flex;
}

.btn-download {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}
.btn-download:hover { background: rgba(16, 185, 129, 0.3); }

.btn-upload-siscob {
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}
.btn-upload-siscob:hover { background: rgba(139, 92, 246, 0.3); }

/* ==========================================================================
   LIVE CONTRACTS TABLE
   ========================================================================== */

.table-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-header-bar {
  padding: 1.2rem 1.6rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.table-view-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.25rem;
}

.table-view-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.table-view-btn:hover {
  color: var(--text-main);
}

.table-view-btn.active {
  background: var(--bg-card-hover);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
}

.table-search {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  color: var(--text-main);
  font-size: 0.82rem;
  width: 260px;
}
.table-search:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.table-container {
  max-height: 440px;
  overflow-y: auto;
}

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

thead {
  position: sticky;
  top: 0;
  background: #0f172a;
  z-index: 10;
}

th {
  padding: 0.85rem 1.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
}

td {
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
}

.badge-sit {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  display: inline-block;
}

.badge-sit.liquidado { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-sit.ativo { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-sit.cancelado { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }
.badge-sit.erro { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-sit.nao-localizado { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }

.mono-cell {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* ==========================================================================
   MODAL DIALOGS & TOASTS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.4rem;
  color: var(--text-main);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  animation: slideInRight 0.3s ease;
  min-width: 300px;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-color: rgba(16, 185, 129, 0.4); }
.toast.error { border-color: rgba(244, 63, 94, 0.4); }
.toast.warning { border-color: rgba(245, 158, 11, 0.4); }

/* ==========================================================================
   AUTOMATED SCHEDULER STYLES
   ========================================================================== */

.scheduler-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
}

.scheduler-status-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scheduler-status-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

/* Switch Toggle Control */
.switch-control {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.25s ease;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s ease;
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Scheduler Next Run Card */
.scheduler-next-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.sched-next-icon {
  font-size: 1.8rem;
  background: rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sched-next-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sched-next-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 600;
}

.sched-next-time {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.sched-next-countdown {
  font-size: 0.85rem;
  color: #a5b4fc;
  font-weight: 500;
}

/* Weekdays Selector Grid */
.weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.weekday-item {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: var(--transition);
  user-select: none;
}

.weekday-item input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.weekday-item:has(input:checked) {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.6);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.sched-quick-links {
  display: flex;
  gap: 0.6rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.btn-text:hover {
  text-decoration: underline;
  color: #a5b4fc;
}

/* Hours Manager */
.hours-input-container {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.hours-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 38px;
  padding: 0.4rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.hour-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #e0e7ff;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hour-tag-remove {
  background: none;
  border: none;
  color: #fb7185;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  margin-left: 0.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hour-tag-remove:hover {
  color: #f43f5e;
}

/* Conflict Options */
.conflict-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.conflict-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.conflict-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.conflict-option:has(input:checked) {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.08);
}

.conflict-option input {
  margin-top: 0.2rem;
  accent-color: var(--primary);
}

.conflict-label-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.conflict-label-text strong {
  font-size: 0.88rem;
  color: var(--text-main);
}

.conflict-label-text small {
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* Last Run Box */
.sched-last-run-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sched-last-run-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
}

.sched-last-run-msg {
  font-size: 0.82rem;
  color: var(--text-main);
}

/* ==========================================================================
   SETTINGS MODAL & HEADER BUTTON (GLASSMORPHISM)
   ========================================================================== */
.btn-settings-header {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-settings-header:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
  transform: translateY(-1px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 40px rgba(56, 189, 248, 0.12);
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.6rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.modal-header-info h2 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.modal-header-info p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: all 0.18s ease;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fb7185;
  transform: scale(1.05);
}

.modal-body {
  padding: 1.6rem;
  overflow-y: auto;
}
