/* ===========================================
   TselZap Dashboard - Modern CSS Styles
   ========================================== */

/* CSS Variables for Theme Management */
:root {
  /* Primary Colors - Based on TselZap Logo */
  --primary-color: #0f172a;
  --primary-dark: #020617;
  --primary-light: #1e293b;
  
  /* Secondary Colors */
  --secondary-color: #0f172a;
  --accent-color: #0f172a;
  
  /* Gradient Colors from Logo */
  --gradient-start: #0f172a;
  --gradient-middle: #1e293b;
  --gradient-end: #0f172a;
  
  /* Menu Colors */
  --menu-bg: #020617;
  --menu-bg-dark: #0f172a;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  
  /* Text Colors */
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  
  /* Border Colors */
  --border-color: #dee2e6;
  --border-light: #f1f3f4;
  
  /* Status Colors */
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  
  /* Shadows */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  
  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-primary: #1e1b4b;
  --bg-secondary: #312e81;
  --bg-tertiary: #4c1d95;
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #a0aec0;
  --border-color: #4c1d95;
  --border-light: #312e81;
  
  /* Dark theme gradients */
  --gradient-start: #020617;
  --gradient-middle: #0f172a;
  --gradient-end: #020617;
  
  /* Dark theme menu color */
  --primary-dark: #020617;
  --menu-bg: #0f172a;
  --menu-bg-dark: #1e293b;
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ===========================================
   LOADING SCREEN
   ========================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle), var(--gradient-end));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity var(--transition-slow);
}

.loading-container {
  text-align: center;
  color: white;
}

.loading-logo {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-logo img {
  height: 80px;
  width: auto;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

.loading-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.loading-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ===========================================
   MODERN LOGIN MODAL
   ========================================== */

.login-modern-modal {
  background: #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  max-width: 389px;
  width: 73vw;
}

.login-modern-container {
  padding: 2.43rem 2.03rem;
  text-align: center;
}

/* Logo Section */
.login-modern-logo {
  background: var(--primary-color);
  margin: -2.43rem -2.03rem 1.62rem -2.03rem;
  padding: 1.62rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-modern-logo img {
  height: 40px;
  width: auto;
}

/* Header Section */
.login-modern-header {
  margin-bottom: 1.62rem;
}

.login-modern-title {
  font-size: 1.22rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.41rem;
  line-height: 1.4;
}

.login-modern-subtitle {
  color: #6b7280;
  font-size: 0.81rem;
  margin: 0;
}

/* Tabs Section */
.login-modern-tabs {
  display: flex;
  margin-bottom: 2rem;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 4px;
}

.login-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  color: #6b7280;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.login-tab.active {
  background: var(--primary-color);
  color: white;
}

.login-tab:not(.active):hover {
  color: #374151;
}

/* Form Section */
.login-modern-form {
  text-align: left;
}

.form-group-modern {
  margin-bottom: 1.35rem;
}

.form-label-modern {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 500;
  color: #374151;
  font-size: 0.86rem;
}

.form-control-modern {
  width: 100%;
  padding: 0.79rem 0.9rem;
  border: 2px solid #e5e7eb;
  border-radius: 7px;
  font-size: 0.9rem;
  background: white;
  transition: all var(--transition-fast);
  color: #374151;
}

.form-control-modern:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.form-control-modern::placeholder {
  color: #9ca3af;
}

/* Primary Button */
.btn-modern-primary {
  width: 100%;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.9rem 1.35rem;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.9rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-modern-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

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

/* Error Alert */
.login-modern-form .alert {
  border-radius: 8px;
  margin-top: 1rem;
  border: none;
}

/* Mobile Responsive */
@media (max-width: 575.98px) {
  .login-modern-modal {
    width: 95vw;
    margin: 1rem;
  }
  
  .login-modern-container {
    padding: 2rem 1.5rem;
  }
  
  .login-modern-logo {
    margin: -2rem -1.5rem 1.5rem -1.5rem;
    padding: 1.5rem;
  }
  
  .login-modern-title {
    font-size: 1.25rem;
  }
}

/* ===========================================
   SIDEBAR
   ========================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  z-index: 1000;
  transition: transform var(--transition-normal);
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.sidebar-logo img {
  height: 45px;
  width: auto;
  transition: all var(--transition-normal);
}

.sidebar-logo:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.3));
}

.sidebar-logo i {
  margin-right: 0.5rem;
  font-size: 2rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
}

.sidebar-menu {
  padding: 1rem 0;
  background: linear-gradient(180deg, var(--menu-bg), var(--menu-bg-dark));
  margin: 0 -1px;
}

.sidebar-menu .nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.sidebar-menu .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-left-color: var(--primary-light);
}

.sidebar-menu .nav-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-left-color: var(--primary-light);
}

.sidebar-menu .nav-link i {
  width: 20px;
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

.sidebar-menu .nav-link .badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.status-indicator {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
  animation: pulse 2s infinite;
}

.status-dot.online {
  background: var(--success-color);
}

.status-dot.offline {
  background: var(--danger-color);
}

.status-dot.connecting {
  background: var(--warning-color);
}

/* ===========================================
   MAIN CONTENT
   ========================================== */

.main-content {
  margin-left: 280px;
  min-height: 100vh;
  background: var(--bg-secondary);
  transition: margin-left var(--transition-normal);
}

.top-bar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-left {
  display: flex;
  align-items: center;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  margin-left: 1rem;
}

.top-bar-actions {
  display: flex;
  align-items: center;
}

.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger-color);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-dropdown {
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
}

.page-container {
  padding: 1.5rem;
}

/* ===========================================
   STATS CARDS
   ========================================== */

.stats-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.stats-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-middle), var(--gradient-end));
}

.stats-card-primary::before {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.stats-card-success::before {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.stats-card-warning::before {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.stats-card-info::before {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.stats-icon {
  font-size: 2.5rem;
  opacity: 0.8;
  margin-bottom: 1rem;
}

.stats-card-primary .stats-icon {
  color: var(--primary-color);
}

.stats-card-success .stats-icon {
  color: var(--primary-color);
}

.stats-card-warning .stats-icon {
  color: var(--primary-color);
}

.stats-card-info .stats-icon {
  color: var(--primary-color);
}

.stats-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1;
}

.stats-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0.5rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-trend {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.stats-trend i {
  margin-right: 0.25rem;
}

/* ===== WARMING SYSTEM STYLES ===== */
.warming-active {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24) !important;
    color: white;
}

.warming-completed {
    background: linear-gradient(135deg, #00d2d3, #01a3a4) !important;
    color: white;
}

.warming-success {
    background: linear-gradient(135deg, #5f27cd, #341f97) !important;
    color: white;
}

.warming-interactions {
    background: linear-gradient(135deg, #ff9ff3, #f368e0) !important;
    color: white;
}

.warming-devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.warming-device-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: var(--border);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.warming-device-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.warming-device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.warming-device-info h5 {
    margin: 0;
    color: var(--text-primary);
}

.warming-device-info small {
    color: var(--text-secondary);
}

.warming-status {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.warming-status.active {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.warming-status.completed {
    background: rgba(0, 210, 211, 0.1);
    color: #00d2d3;
}

.warming-status.paused {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.warming-progress-section {
    margin: 1rem 0;
}

.warming-day-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.warming-progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.warming-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ee5a24);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.warming-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.warming-stat-item {
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 107, 107, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.1);
}

.warming-stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ff6b6b;
    margin: 0;
}

.warming-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.warming-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.warming-timeline {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: var(--border);
    padding: 2rem;
    margin-top: 1rem;
}

.timeline-container {
    position: relative;
    padding: 1rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin: 2rem 0;
    display: flex;
    align-items: center;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-content {
    flex: 1;
    background: var(--card-bg);
    border: var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin: 0 1rem;
    max-width: 45%;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    border: 3px solid white;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.timeline-marker.completed {
    background: #00d2d3;
}

.timeline-marker.current {
    background: #ffc107;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

/* ===========================================
   CHART CARDS
   ========================================== */

.chart-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.chart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.chart-actions {
  display: flex;
  gap: 0.5rem;
}

.chart-body {
  padding: 1.5rem;
  position: relative;
  height: 300px;
}

/* ===========================================
   ACTIVITY CARD
   ========================================== */

.activity-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.activity-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.activity-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.activity-body {
  max-height: 400px;
  overflow-y: auto;
}

.activity-list {
  padding: 0;
}

.activity-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  transition: background var(--transition-fast);
}

.activity-item:hover {
  background: var(--bg-secondary);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.1rem;
}

.activity-content {
  flex: 1;
}

.activity-title-text {
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}

.activity-description {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.85rem;
}

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

/* ===========================================
   DEVICE CARDS
   ========================================== */

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

.device-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  position: relative;
}

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

.device-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.device-status.online {
  background: var(--success-color);
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

.device-status.offline {
  background: var(--danger-color);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3);
}

.device-status.busy {
  background: var(--warning-color);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3);
}

.device-info {
  margin-bottom: 1rem;
}

.device-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.device-phone {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

.device-progress {
  margin: 1rem 0;
}

.device-progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.progress {
  height: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
}

.progress-bar {
  border-radius: var(--radius-sm);
}

.device-actions {
  display: flex;
  gap: 0.5rem;
}

/* ===========================================
   TABLE CARDS
   ========================================== */

.table-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.table-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.table-body {
  overflow-x: auto;
}

.table {
  margin: 0;
}

.table th {
  background: var(--bg-secondary);
  border: none;
  padding: 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.table td {
  padding: 1rem;
  border: none;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: var(--bg-secondary);
}

/* ===========================================
   MINI STATS CARDS
   ========================================== */

.mini-stats-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  transition: all var(--transition-fast);
}

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

.mini-stats-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  margin-right: 1rem;
}

.mini-stats-content h4 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.mini-stats-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ===========================================
   FILTER CARDS
   ========================================== */

.filter-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

/* ===========================================
   PAGE HEADER
   ========================================== */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.page-header .page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* ===========================================
   LOGS CONTAINER
   ========================================== */

.logs-container {
  font-family: 'Courier New', monospace;
  background: #1a1a1a;
  color: #00ff00;
  padding: 1rem;
  border-radius: var(--radius-md);
  max-height: 600px;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.4;
}

.log-entry {
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
}

.log-timestamp {
  color: #888;
  margin-right: 0.5rem;
}

.log-level-info {
  color: #00bfff;
}

.log-level-warn {
  color: #ffa500;
}

.log-level-error {
  color: #ff4444;
}

/* ===========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
  }
  
  .overlay.show {
    opacity: 1;
    visibility: visible;
  }
  
  .page-title {
    font-size: 1.25rem !important;
    margin-left: 0.5rem !important;
  }
  
  .top-bar {
    padding: 1rem;
  }
  
  .page-container {
    padding: 1rem;
  }
  
  .stats-card {
    margin-bottom: 1rem;
  }
  
  .chart-body {
    height: 250px;
  }
  
  .devices-grid {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 575.98px) {
  .login-container {
    padding: 2rem 1.5rem;
  }
  
  .top-bar-actions {
    gap: 0.5rem;
  }
  
  .top-bar-actions .btn {
    padding: 0.25rem 0.5rem;
  }
  
  .stats-number {
    font-size: 2rem;
  }
  
  .chart-body {
    height: 200px;
    padding: 1rem;
  }
}

/* ===========================================
   ANIMATION CLASSES
   ========================================== */

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

.scale-in {
  animation: scaleIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { 
    opacity: 0;
    transform: scale(0.9);
  }
  to { 
    opacity: 1;
    transform: scale(1);
  }
}

/* ===========================================
   UTILITY CLASSES
   ========================================== */

.text-gradient {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle));
}

.bg-gradient-full {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle), var(--gradient-end));
}

.tselzap-brand {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.tselzap-button {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle), var(--gradient-end));
  border: none;
  color: white;
  transition: all var(--transition-fast);
}

.tselzap-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.3);
  color: white;
}

.border-gradient {
  position: relative;
}

.border-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

/* Print Styles */
@media print {
  .sidebar,
  .top-bar,
  .loading-overlay {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  .stats-card,
  .chart-card,
  .table-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* ===========================================
   NOVOS ESTILOS PARA EXECUÇÃO EM TEMPO REAL
   ========================================== */

/* Animação para linhas atualizadas em tempo real */
.table-row-updated {
  background: linear-gradient(90deg, 
    rgba(40, 167, 69, 0.1) 0%, 
    rgba(40, 167, 69, 0.2) 50%, 
    rgba(40, 167, 69, 0.1) 100%);
  animation: taskUpdateGlow 2s ease-in-out;
  border-left: 3px solid var(--success-color);
  transition: all 0.3s ease;
}

@keyframes taskUpdateGlow {
  0% {
    background: rgba(40, 167, 69, 0.3);
    transform: scale(1);
  }
  50% {
    background: rgba(40, 167, 69, 0.2);
    transform: scale(1.01);
  }
  100% {
    background: rgba(40, 167, 69, 0.1);
    transform: scale(1);
  }
}

/* Container de logs de execução */
#execution-logs {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  background: var(--bg-secondary);
}

.log-entry {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px 12px;
  margin-bottom: 5px;
  background: var(--bg-primary);
  border-radius: 6px;
  border-left: 3px solid var(--info-color);
  font-size: 0.9em;
  animation: logEntrySlide 0.3s ease-in-out;
}

@keyframes logEntrySlide {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.log-timestamp {
  color: var(--text-muted);
  font-size: 0.8em;
  min-width: 120px;
}

.log-device {
  color: var(--primary-color);
  font-weight: 600;
  min-width: 150px;
}

.log-task {
  color: var(--info-color);
  font-weight: 500;
  flex-grow: 1;
}

.log-details {
  color: var(--text-secondary);
  font-size: 0.85em;
}

/* Status badges melhorados */
.badge.bg-warning {
  background: linear-gradient(135deg, #ffc107, #ffca2c);
  color: #212529;
  animation: pulseWarning 2s infinite;
}

@keyframes pulseWarning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.counter-updated {
  color: var(--success-color);
  font-weight: bold;
  animation: counterPulse 0.5s ease-in-out;
}

@keyframes counterPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

