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

:root {
  /* Premium Light Theme Palette */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  
  --border-color: #e2e8f0;
  --border-focus: rgba(59, 130, 246, 0.6);
  
  --text-main: #0f172a;
  --text-secondary: #64748b;
  
  /* Vibrant Accents */
  --accent: #14b8a6; /* Teal */
  --accent-hover: #0d9488;
  --accent-gradient: linear-gradient(135deg, #14b8a6 0%, #3b82f6 100%);
  --accent-gradient-hover: linear-gradient(135deg, #0d9488 0%, #2563eb 100%);
  --accent-glow: 0 0 20px rgba(20, 184, 166, 0.4);
  
  --danger: #f43f5e;
  --danger-hover: #e11d48;
  --danger-gradient: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
  
  --warning: #f59e0b;
  --success: #10b981;
  
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', system-ui, -apple-system, sans-serif;
  --sidebar-width: 280px;
  
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --glass-blur: blur(16px);
}

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

body {
  background-color: var(--bg-main);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

a, button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Authentication Screen */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.auth-container::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(20, 184, 166, 0.08) 0%, transparent 60%);
  z-index: -1;
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  box-shadow: var(--glass-shadow);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  transform: translateY(0);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px 0 rgba(0, 0, 0, 0.4);
}

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

.auth-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-heading);
}

.form-input {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 18px;
  padding-right: 36px;
}

/* Checkboxes */
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  border-radius: 4px;
  cursor: pointer;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

/* Premium Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-heading);
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(20, 184, 166, 0.3);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--accent-glow);
}

.btn-secondary {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background-color: var(--danger-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

.btn-block {
  display: flex;
  width: 100%;
}

.auth-switch {
  margin-top: 28px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-switch-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.auth-switch-link:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(20, 184, 166, 0.5);
}

.error-message {
  background-color: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
  font-size: 13px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: none;
  backdrop-filter: blur(4px);
}

.success-message {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  font-size: 13px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: none;
  backdrop-filter: blur(4px);
}

/* Dashboard Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background-color: var(--bg-sidebar);
  color: #f8fafc;
  border-right: none;
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
  padding: 32px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-item:hover {
  color: #f8fafc;
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.nav-item.active {
  background: #3b82f6;
  color: #ffffff;
  font-weight: 600;
  border: none;
}


.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.1);
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.btn-logout {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #fda4af;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fff;
  transform: scale(1.05);
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  padding: 48px;
  max-width: 1400px;
  width: calc(100% - var(--sidebar-width));
}

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

.page-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.page-actions {
  display: flex;
  gap: 16px;
}

/* Cards & Layout Modules */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e1;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-main);
}

/* System Status Ribbon */
.system-status-bar {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 32px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  position: relative;
}

.status-dot.online {
  background-color: var(--success);
  box-shadow: 0 0 12px var(--success);
}

.status-dot.online::after {
  content: "";
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  border-radius: 50%;
  border: 2px solid var(--success);
  opacity: 0;
  animation: ripple 2s infinite ease-out;
}

@keyframes ripple {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(2.5); opacity: 0; }
}

.status-dot.offline {
  background-color: var(--danger);
  box-shadow: 0 0 12px var(--danger);
}

/* Account Sessions CSS */
.session-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.session-name-wrapper {
  display: flex;
  flex-direction: column;
}

.session-label {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.session-id {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
}

.badge-disconnected {
  background-color: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.3);
}

.badge-connected {
  background-color: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-starting {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
}

.badge-scan_qr {
  background-color: rgba(20, 184, 166, 0.15);
  color: #5eead4;
  border-color: rgba(20, 184, 166, 0.3);
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 12px;
  width: 100%;
  max-width: 220px;
  align-self: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.2);
}

.qr-image {
  width: 100%;
  height: auto;
  display: block;
}

.qr-placeholder {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  text-align: center;
}

.session-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Blast Module Layout */
.blast-form-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.phone-list-area {
  font-family: monospace;
  font-size: 13px;
}

.helper-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.blast-delay-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Modern Data Table */
.table-container {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  box-shadow: var(--glass-shadow);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.table th {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 18px 24px;
  font-family: var(--font-heading);
}

.table td {
  border-bottom: 1px solid var(--border-color);
  padding: 18px 24px;
  vertical-align: middle;
  font-size: 14px;
  transition: background-color 0.15s ease;
}

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

.table tr:hover td {
  background-color: #f1f5f9;
}

/* Progress bar inside tables or panels */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.progress-track {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  height: 8px;
  flex-grow: 1;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.progress-fill {
  background-color: var(--accent);
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.3);
}

.progress-text {
  font-size: 12px;
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
  font-family: monospace;
}

/* Modal Popup (for details/add session) */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 5, 16, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 24px;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-header {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.02);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
  transform: rotate(90deg);
}

.modal-body {
  padding: 32px;
}

.modal-footer {
  padding: 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  background: rgba(0, 0, 0, 0.2);
}

/* Helper UTILS */
.text-danger { color: #f43f5e; }
.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }
.text-muted { color: var(--text-secondary); }

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

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.d-none { display: none !important; }

/* Responsive adjustments */
@media (max-width: 900px) {
  .sidebar {
    width: 72px;
  }
  .sidebar-logo, .nav-text, .user-info, .sidebar-footer .btn-logout span {
    display: none;
  }
  .sidebar-header {
    padding: 24px 12px;
    text-align: center;
  }
  .sidebar-nav {
    padding: 20px 12px;
  }
  .nav-item {
    padding: 12px;
    justify-content: center;
  }
  .nav-item.active::before {
    border-radius: 4px;
    width: 3px;
    left: 2px;
  }
  .main-content {
    margin-left: 72px;
    width: calc(100% - 72px);
    padding: 24px;
  }
  .blast-form-layout {
    grid-template-columns: 1fr;
  }
}

/* Pagination Styling */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pagination-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text-main);
  background: rgba(20, 184, 166, 0.1);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: var(--font-heading);
}

/* MODERN DASHBOARD STYLES */
.dashboard-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1.5rem;
}
.page-title-modern {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.5rem 0;
}
.page-subtitle-modern {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}
.status-indicator-modern {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-main);
  font-weight: 500;
}
.status-indicator-modern .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}
.status-indicator-modern .status-dot.online {
  background-color: var(--success);
}

.grid-modern-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card-modern {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}
.card-modern-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.card-modern-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem 0;
}
.card-modern-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}
.card-modern-value .unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.card-modern-value.text-blue {
  color: #60a5fa;
}

.card-modern-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bg-blue-light {
  background-color: rgba(59, 130, 246, 0.1);
}
.bg-gray-light {
  background-color: rgba(255, 255, 255, 0.05);
}

.card-modern-link {
  font-size: 0.875rem;
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
}
.card-modern-link:hover {
  text-decoration: underline;
}

.card-modern-footer {
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.text-blue { color: #60a5fa; }
.text-dark { color: var(--text-main); }

.chart-card {
  padding: 2rem;
}
.chart-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

/* Segment Pills */
.segment-pill {
  padding: 6px 16px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.segment-pill:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.segment-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

/* Template Grid and Cards */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.1);
}

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

.template-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.template-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.template-badge.promosi { background: #e0f2fe; color: #0369a1; }
.template-badge.tagihan { background: #fee2e2; color: #b91c1c; }
.template-badge.greeting { background: #dcfce7; color: #15803d; }
.template-badge.edukasi { background: #fef3c7; color: #b45309; }
.template-badge.umum { background: #f1f5f9; color: #475569; }

.template-card-body {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  flex-grow: 1;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 16px;
}

.template-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 12px;
}

.template-actions {
  display: flex;
  gap: 8px;
}

.template-actions button {
  background: transparent;
  border: none;
  padding: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}
.template-actions button:hover {
  color: var(--text-main);
}

/* Device Grid and Cards */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.device-card-info-left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.device-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.device-phone {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.device-status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.device-status-badge.connected { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.device-status-badge.disconnected { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.device-status-badge.starting { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.device-status-badge svg {
  width: 12px; height: 12px;
}

.device-stats-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.device-stat-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.device-stat-value {
  font-size: 0.875rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.device-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-device-action {
  flex-grow: 1;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-device-action.disconnect {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.btn-device-action.disconnect:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-device-action.connect {
  background: #7c3aed;
  color: #fff;
}
.btn-device-action.connect:hover {
  background: #6d28d9;
}

.btn-device-action.starting {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.btn-device-delete {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-device-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: transparent;
}
