* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}
.view { display: flex; min-height: 100vh; }

/* Login */
#login-view { align-items: center; justify-content: center; background: linear-gradient(135deg, #075e54, #128c7e); }
.login-card {
  background: white; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.login-logo { text-align: center; font-size: 24px; font-weight: 800; color: #25D366; margin-bottom: 8px; }
.login-title { text-align: center; font-size: 18px; color: #666; margin-bottom: 32px; font-weight: 400; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: #555; margin-bottom: 6px; }
.form-group input, .form-group select {
  width: 100%; padding: 12px 16px; border: 2px solid #e0e0e0; border-radius: 8px;
  font-size: 15px; transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: #25D366; }
.error-msg { color: #e74c3c; font-size: 14px; margin-bottom: 16px; display: none; }
.success-msg { color: #2e7d32; font-size: 14px; margin-bottom: 16px; display: none; }
.btn {
  padding: 12px 24px; border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; width: 100%;
}
.btn-primary { background: #25D366; color: white; }
.btn-primary:hover { background: #1da851; }
.btn-outline { background: transparent; border: 2px solid #25D366; color: #25D366; width: auto; }
.btn-outline:hover { background: #25D366; color: white; }
.btn-danger { background: #e74c3c; color: white; width: auto; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 6px 12px; font-size: 13px; width: auto; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Captcha */
.captcha-group { margin-bottom: 16px; }
.captcha-group label { font-size: 15px; font-weight: 700; color: #075e54; margin-bottom: 8px; }
.captcha-row { display: flex; gap: 8px; }
.captcha-row input { flex: 1; }
.captcha-row .btn { flex-shrink: 0; font-size: 18px; padding: 12px 14px; width: auto; }

/* Dashboard */
#dashboard-view { flex-direction: column; }
.dashboard-header {
  background: white; padding: 16px 32px; display: flex; justify-content: space-between;
  align-items: center; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.header-left h1 { font-size: 20px; color: #075e54; }
.header-subtitle { font-size: 13px; color: #999; }
.header-right { display: flex; align-items: center; gap: 16px; }
.admin-badge {
  background: #e8f5e9; color: #2e7d32; padding: 6px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
}

/* Tabs */
.admin-tabs {
  display: flex; gap: 0; padding: 0 32px; background: white; border-bottom: 2px solid #f0f0f0;
}
.tab-btn {
  padding: 14px 24px; border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #999; border-bottom: 3px solid transparent;
  transition: all 0.2s; margin-bottom: -2px;
}
.tab-btn:hover { color: #075e54; }
.tab-btn.active { color: #075e54; border-bottom-color: #25D366; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; padding: 24px 32px; }
.stat-card {
  background: white; border-radius: 12px; padding: 20px; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-label { display: block; font-size: 13px; color: #999; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.stat-value { display: block; font-size: 32px; font-weight: 800; }
.stat-card.total .stat-value { color: #075e54; }
.stat-card.verified .stat-value { color: #2196f3; }
.stat-card.trial .stat-value { color: #ff9800; }
.stat-card.active .stat-value { color: #4caf50; }
.stat-card.disabled .stat-value { color: #f44336; }
.stat-card.expired .stat-value { color: #9e9e9e; }

/* Table Actions */
.table-actions {
  display: flex; gap: 16px; padding: 0 32px 16px; align-items: center;
}
.search-box { flex: 1; }
.search-box input {
  width: 100%; padding: 10px 16px; border: 2px solid #e0e0e0; border-radius: 8px;
  font-size: 14px;
}
.search-box input:focus { outline: none; border-color: #25D366; }
.filter-box select {
  padding: 10px 16px; border: 2px solid #e0e0e0; border-radius: 8px;
  font-size: 14px; background: white; min-width: 160px;
}

/* Table */
.table-container { margin: 0 32px 32px; background: white; border-radius: 12px; overflow-x: auto; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 14px 16px; text-align: left; font-size: 12px; font-weight: 700;
  color: #999; text-transform: uppercase; letter-spacing: 0.5px;
  background: #fafafa; border-bottom: 2px solid #f0f0f0; white-space: nowrap;
}
tbody td { padding: 14px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
tbody tr:hover { background: #f8fff9; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.row-expiring-soon { background: #fff8e1; }
tbody tr.row-expiring-soon:hover { background: #fff3cd; }
tbody tr.row-expiring-soon td:first-child { border-left: 3px solid #f57f17; }

.status-badge {
  display: inline-block; padding: 4px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.status-pending { background: #fff3e0; color: #e65100; }
.status-trial { background: #fff8e1; color: #f57f17; }
.status-active { background: #e8f5e9; color: #2e7d32; }
.status-disabled { background: #ffebee; color: #c62828; }
.status-expired { background: #f5f5f5; color: #757575; }

.verified-badge { font-size: 16px; }
.verified-yes { color: #4caf50; }
.verified-no { color: #e0e0e0; }

.action-btns { display: flex; gap: 6px; }
.empty-state { text-align: center; color: #999; padding: 48px; font-size: 16px; }

/* SMTP Config */
.smtp-card {
  background: white; border-radius: 12px; padding: 32px; margin: 24px 32px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); max-width: 800px;
}
.smtp-title { font-size: 20px; color: #075e54; margin-bottom: 8px; }
.smtp-subtitle { font-size: 14px; color: #999; margin-bottom: 28px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-group { display: flex; align-items: flex-end; }
.checkbox-label {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 14px; color: #555; font-weight: 500;
}
.checkbox-label input[type="checkbox"] {
  width: 18px; height: 18px; cursor: pointer; accent-color: #25D366;
}

/* Test Modal */
.test-modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); display: flex; align-items: center;
  justify-content: center; z-index: 1001;
}
.test-modal-content {
  background: white; border-radius: 16px; padding: 32px;
  width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.test-modal-content h3 { font-size: 18px; color: #075e54; margin-bottom: 8px; }
.test-modal-content p { font-size: 14px; color: #999; margin-bottom: 20px; }
.test-modal-btns { display: flex; gap: 12px; margin-top: 12px; justify-content: flex-end; }
.smtp-test-result {
  padding: 12px; border-radius: 8px; font-size: 14px; margin-bottom: 12px;
}
.smtp-test-result.success { background: #e8f5e9; color: #2e7d32; }
.smtp-test-result.error { background: #ffebee; color: #c62828; }

/* Toast */
.toast {
  position: fixed; bottom: 32px; right: 32px; padding: 16px 24px; border-radius: 8px;
  color: white; font-weight: 500; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transform: translateY(120px); opacity: 0; transition: all 0.3s ease; z-index: 1000;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: #4caf50; }
.toast.error { background: #f44336; }
.toast.info { background: #2196f3; }

/* === License Modal === */
.license-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); display: flex; align-items: center;
  justify-content: center; z-index: 1002;
}
.license-modal {
  background: white; border-radius: 16px; width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); overflow: hidden;
}
.license-modal-header {
  padding: 24px 24px 0;
}
.license-modal-header h3 {
  font-size: 18px; color: #075e54; margin-bottom: 6px;
}
.license-modal-header p {
  font-size: 14px; color: #999; margin-bottom: 16px;
}
.license-modal-body {
  padding: 16px 24px;
}
.license-modal-footer {
  padding: 16px 24px 24px; display: flex; gap: 12px; justify-content: flex-end;
}
.form-select {
  width: 100%; padding: 10px 16px; border: 2px solid #e0e0e0; border-radius: 8px;
  font-size: 14px; background: white; cursor: pointer;
}
.form-select:focus { outline: none; border-color: #25D366; }
.license-key-display {
  background: #f0f9f4; border: 2px solid #25D366; border-radius: 12px;
  padding: 20px; text-align: center;
}
.license-key-label {
  font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.license-key-value {
  font-size: 20px; font-weight: 800; color: #075e54; font-family: monospace;
  letter-spacing: 2px; user-select: all;
}
.license-details {
  background: #f8f9fa; border-radius: 8px; padding: 12px 16px;
}
.license-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 14px;
}

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); padding: 16px; }
  .dashboard-header { flex-direction: column; gap: 12px; padding: 16px; }
  .table-actions { flex-direction: column; padding: 0 16px 16px; }
  .table-container { margin: 0 16px 16px; }
  .smtp-card { margin: 16px; padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .admin-tabs { padding: 0 16px; }
}
