/* ==========================================
   LogiTrack — Light Theme Stylesheet
   ========================================== */

/* --- Message Type Selector --- */
.message-type-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}
.radio-card {
  cursor: pointer;
  position: relative;
}
.radio-card input {
  position: absolute;
  opacity: 0;
}
.radio-card-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  transition: var(--transition);
}
.radio-card-content i {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}
.radio-card input:checked + .radio-card-content {
  border-color: var(--accent-blue);
  background: var(--accent-blue-lt);
  color: var(--accent-blue);
}
.radio-card input:checked + .radio-card-content i {
  color: var(--accent-blue);
}

.spin {
  animation: spinner 0.8s linear infinite;
}
@keyframes spinner {
  to { transform: rotate(360deg); }
}

:root {
  /* Light Color Palette */
  --bg-primary:     #f0f4f8;
  --bg-secondary:   #e8edf2;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f8fafc;
  --bg-input:       #f8fafc;
  --sidebar-bg:     #ffffff;
  --sidebar-width:  252px;

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  --accent-blue:    #2563eb;
  --accent-blue-2:  #3b82f6;
  --accent-blue-lt: #eff6ff;
  --accent-green:   #059669;
  --accent-green-lt:#ecfdf5;
  --accent-red:     #dc2626;
  --accent-red-lt:  #fef2f2;
  --accent-yellow:  #d97706;
  --accent-yellow-lt:#fffbeb;
  --accent-purple:  #7c3aed;
  --accent-cyan:    #0891b2;
  --whatsapp:       #25d366;
  --whatsapp-dark:  #128c7e;

  --border:         #e2e8f0;
  --border-focus:   #93c5fd;
  --border-strong:  #cbd5e1;

  --shadow-xs:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.12);

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --transition: 0.18s ease;
  --transition-slow: 0.35s ease;
}

/* ==========================================
   Reset & Base
   ========================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  line-height: 1.6;
}
a { color: var(--accent-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-blue-2); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition: transform var(--transition-slow);
  box-shadow: var(--shadow-sm);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  display: block;
}
.brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  padding: 10px 8px 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.nav-link:hover {
  background: var(--accent-blue-lt);
  color: var(--accent-blue);
}
.nav-link.active {
  background: var(--accent-blue-lt);
  color: var(--accent-blue);
  font-weight: 600;
  border-left: 3px solid var(--accent-blue);
}
.nav-icon { 
  width: 18px; 
  height: 18px; 
  flex-shrink: 0; 
  color: var(--text-muted);
  transition: color var(--transition);
}
.nav-link.active .nav-icon,
.nav-link:hover .nav-icon {
  color: var(--accent-blue);
}

.nav-link.text-danger {
  color: var(--accent-red);
}
.nav-link.text-danger .nav-icon {
  color: var(--accent-red);
  opacity: 0.8;
}
.nav-link.text-danger:hover {
  background: rgba(220, 38, 38, 0.05);
  color: var(--accent-red);
}
.nav-link.text-danger:hover .nav-icon {
  color: var(--accent-red);
  opacity: 1;
}

.badge {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}
.badge-danger  { background: var(--accent-red);   color: #fff; }
.badge-success { background: var(--accent-green); color: #fff; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.wa-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(5,150,105,0.2);
  animation: pulse 2.5s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

/* ==========================================
   Overlay (mobile)
   ========================================== */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.35);
  z-index: 190;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ==========================================
   Main Wrapper
   ========================================== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ==========================================
   Topbar
   ========================================== */
.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

.sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg-primary); }
.sidebar-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.2s;
}

.topbar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.topbar-time {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================
   Content Area
   ========================================== */
.content {
  flex: 1;
  padding: 20px;
}

/* ==========================================
   Cards
   ========================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title i, .card-title [data-lucide] {
  width: 18px;
  height: 18px;
  color: var(--accent-blue);
}

/* ==========================================
   Stats Grid
   ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px -10px var(--stat-color-glow);
  border-color: var(--stat-color);
}
.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: all var(--transition);
}
.stat-icon-wrapper i {
  width: 22px;
  height: 22px;
  color: var(--stat-color);
}
.stat-card:hover .stat-icon-wrapper {
  background: var(--stat-color);
  transform: scale(1.1) rotate(-8deg);
}
.stat-card:hover .stat-icon-wrapper i {
  color: #fff;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 3px;
}
.stat-label { font-size: 0.78rem; color: var(--text-secondary); font-weight: 500; }
.stat-change { 
  font-size: 0.75rem; 
  margin-top: 6px; 
  display: flex; 
  align-items: center; 
  gap: 4px; 
  font-weight: 500;
  color: var(--text-muted);
}
.stat-change i { width: 14px; height: 14px; }
.stat-change.up   { color: var(--accent-green); }
.stat-change.down { color: var(--accent-red); }

/* ==========================================
   Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 4px 16px rgba(37,99,235,0.35); color: #fff; transform: translateY(-1px); }

.btn-success {
  background: var(--accent-green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5,150,105,0.25);
}
.btn-success:hover { background: #047857; transform: translateY(-1px); color: #fff; }

.btn-danger {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220,38,38,0.2);
}
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); color: #fff; }

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,211,102,0.3);
}
.btn-whatsapp:hover { background: var(--whatsapp-dark); transform: translateY(-1px); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-primary); color: var(--text-primary); border-color: var(--border-strong); }

.btn-sm  { padding: 6px 13px; font-size: 0.8rem; }
.btn-xs  { padding: 5px 9px;  font-size: 0.75rem; border-radius: 6px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ==========================================
   Table
   ========================================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 600px; }

thead th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 11px 14px; color: var(--text-primary); vertical-align: middle; }
.td-muted { color: var(--text-secondary); }

/* ==========================================
   Status Pills
   ========================================== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pill-paid      { background: var(--accent-green-lt); color: var(--accent-green);  border: 1px solid #a7f3d0; }
.pill-unpaid    { background: var(--accent-red-lt);   color: var(--accent-red);    border: 1px solid #fecaca; }
.pill-pending   { background: var(--accent-yellow-lt);color: var(--accent-yellow); border: 1px solid #fde68a; }
.pill-in-transit { background: #fff7ed; color: #ea580c; border: 1px solid #ffedd5; }
.pill-sent      { background: var(--accent-green-lt); color: var(--accent-green);  border: 1px solid #a7f3d0; }
.pill-failed    { background: var(--accent-red-lt);   color: var(--accent-red);    border: 1px solid #fecaca; }
.pill-delivered { background: var(--accent-blue-lt);  color: var(--accent-blue);   border: 1px solid #bfdbfe; }
.pill-read      { background: #f5f3ff; color: var(--accent-purple); border: 1px solid #ddd6fe; }

/* ==========================================
   Forms
   ========================================== */
.form-grid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }

.form-group     { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}
.form-label .req { color: var(--accent-red); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
  background: #fff;
}
.form-input::placeholder { color: var(--text-muted); }
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; }

/* ==========================================
   File / Photo Upload
   ========================================== */
.file-upload-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-input);
  position: relative;
}
.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--accent-blue);
  background: var(--accent-blue-lt);
}
.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.file-upload-icon { font-size: 2rem; margin-bottom: 8px; display: block; }
.file-upload-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-blue);
  display: block;
}
.file-upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* Photo Preview */
.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.photo-preview-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  aspect-ratio: 1;
}
.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-preview-remove {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(220,38,38,0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}

/* Existing photo shown in edit mode */
.existing-photo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.existing-photo img {
  width: 60px; height: 60px;
  border-radius: 6px;
  object-fit: cover;
}
.existing-photo-info { flex: 1; }
.existing-photo-info .name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.existing-photo-info .hint { font-size: 0.72rem; color: var(--text-muted); }

/* ==========================================
   Section Divider
   ========================================== */
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 14px;
}
.section-divider-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-divider hr {
  flex: 1;
  border: none;
  border-top: 1px solid var(--border);
}

/* ==========================================
   Flash Messages
   ========================================== */
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.3s;
  gap: 10px;
}
.flash button { background: none; border: none; color: inherit; font-size: 1.1rem; opacity: 0.6; flex-shrink: 0; }
.flash button:hover { opacity: 1; }
.flash-success { background: #ecfdf5; border-bottom: 1px solid #a7f3d0; color: var(--accent-green); }
.flash-error   { background: #fef2f2; border-bottom: 1px solid #fecaca; color: var(--accent-red); }
.flash-info    { background: #eff6ff; border-bottom: 1px solid #bfdbfe; color: var(--accent-blue); }

/* ==========================================
   Modals
   ========================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.18s ease; }

.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp 0.22s ease;
  box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 760px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.modal-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 1.3rem; line-height: 1;
  padding: 3px 7px; border-radius: 6px; transition: all var(--transition);
}
.modal-close:hover { background: var(--accent-red-lt); color: var(--accent-red); }
.modal-body   { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

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

/* ==========================================
   WhatsApp Send Modal
   ========================================== */
.wa-send-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.wa-phone-mockup {
  background: #e5ddd5;
  border-radius: 16px;
  padding: 14px;
  min-height: 180px;
}
.wa-bubble {
  background: #dcf8c6;
  border-radius: 10px 10px 10px 2px;
  padding: 10px 12px;
  font-size: 0.78rem;
  color: #111;
  white-space: pre-wrap;
  font-family: monospace;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.radio-card:hover { border-color: var(--whatsapp); background: #f0fff4; }
.radio-card input[type="radio"] { accent-color: var(--whatsapp); flex-shrink: 0; }
.radio-label { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }
.send-status-box {
  text-align: center; padding: 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-top: 12px;
}
.send-status-icon { font-size: 2rem; margin-bottom: 8px; }
.send-status-text { font-size: 0.875rem; color: var(--text-secondary); }

/* ==========================================
   Page Header
   ========================================== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-left h1 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.3px;
}
.page-header-left p {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin: 3px 0 0;
}

/* ==========================================
   Filters Bar
   ========================================== */
.filters-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filter-input {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.84rem;
  min-width: 150px;
  flex: 1;
  max-width: 220px;
}
.filter-input:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* ==========================================
   Logs
   ========================================== */
.log-entry {
  display: flex; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.log-entry:last-child { border-bottom: none; }
.log-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.log-dot.sent      { background: var(--accent-green); box-shadow: 0 0 0 2px rgba(5,150,105,0.2); }
.log-dot.failed    { background: var(--accent-red);   box-shadow: 0 0 0 2px rgba(220,38,38,0.2); }
.log-dot.delivered { background: var(--accent-blue);  box-shadow: 0 0 0 2px rgba(37,99,235,0.2); }
.log-dot.read      { background: var(--accent-purple);box-shadow: 0 0 0 2px rgba(124,58,237,0.2); }
.log-body  { flex: 1; min-width: 0; }
.log-title { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.log-meta  { font-size: 0.73rem; color: var(--text-muted); margin-top: 2px; }
.log-error { font-size: 0.78rem; color: var(--accent-red); font-family: monospace; margin-top: 4px; background: var(--accent-red-lt); padding: 5px 9px; border-radius: 5px; }

/* ==========================================
   Empty State
   ========================================== */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 10px; }
.empty-state h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.empty-state p  { font-size: 0.84rem; color: var(--text-secondary); }

/* ==========================================
   Pagination
   ========================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 8px;
}
.page-links { display: flex; gap: 5px; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem; font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}
.page-link:hover, .page-link.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

/* ==========================================
   Info box
   ========================================== */
.info-box {
  background: var(--accent-blue-lt);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 0.83rem;
  color: #1e40af;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}
.info-box-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ==========================================
   Responsive — Mobile First
   ========================================== */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    transform: translateX(-270px);
    width: 252px;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-toggle { display: flex; }
  .main-wrapper   { margin-left: 0; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .wa-send-layout { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }

  .topbar  { padding: 0 14px; }
  .content { padding: 14px; }

  .modal-overlay { padding: 10px; }
  .modal { border-radius: var(--radius-lg); max-height: 95vh; }

  /* Hide less-important table columns on small screens */
  table { min-width: 500px; }

  .btn-sm { padding: 7px 11px; }

  /* Make action buttons stack nicely */
  .action-btns { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-time { display: none; }
  .page-header-left h1 { font-size: 1.1rem; }
  .filters-bar .filter-input { min-width: 120px; }
}

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

/* ==========================================
   Utilities
   ========================================== */
.text-success { color: var(--accent-green); }
.text-danger  { color: var(--accent-red); }
.text-warning { color: var(--accent-yellow); }
.text-blue    { color: var(--accent-blue); }
.text-muted   { color: var(--text-secondary); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-bold    { font-weight: 700; }
.text-sm      { font-size: 0.82rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 16px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}
[data-tooltip]:hover::after { opacity: 1; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}
/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 44px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-blue); }
input:focus + .slider { box-shadow: 0 0 1px var(--accent-blue); }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }
