/* ==========================================================================
   Email Campaign Sender — Super Admin Panel Stylesheet
   Modern, Dark-First Cybernetic SaaS Control Center
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, monospace;
  
  --bg-body: #090d16;
  --bg-sidebar: #0e1526;
  --bg-card: #131c31;
  --bg-card-hover: #18233d;
  --bg-input: #0b1120;
  
  --border-light: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(59, 130, 246, 0.45);
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);
  
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.2);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.2);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Admin Wrapper Layout */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-brand {
  padding: 24px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.brand-info strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
}

.brand-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 1px 6px;
  border-radius: 9999px;
}

.sidebar-nav {
  padding: 20px 14px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding: 10px 12px 6px;
  margin-top: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transform: translateX(3px);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-left: 3px solid var(--primary);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.nav-icon {
  font-size: 17px;
  width: 22px;
  text-align: center;
}

.nav-count-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}

.user-meta strong {
  display: block;
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.2;
}

.user-meta span {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-logout:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.admin-main {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.admin-topbar {
  height: 70px;
  background: rgba(14, 21, 38, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.btn-landing-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.btn-landing-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: var(--primary);
}

/* Page Body Container */
.admin-body {
  padding: 32px;
  flex: 1;
}

/* Alert Notifications */
.alert-box {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* KPI Card Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.kpi-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-purple { background: rgba(139, 92, 246, 0.15); color: #c084fc; }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 8px;
}

.kpi-meta {
  font-size: 11.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.text-emerald { color: #10b981 !important; }
.text-danger { color: #ef4444 !important; }
.text-warning { color: #f59e0b !important; }
.text-blue { color: #3b82f6 !important; }

/* Content Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 24px;
}

/* Quick Action Buttons Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

@media (max-width: 991px) {
  .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
}

.btn-action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.btn-action-card:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
  transform: translateY(-2px);
}

.action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.action-meta strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-main);
}

.action-meta span {
  font-size: 11px;
  color: var(--text-muted);
}

/* Data Tables */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.data-table th {
  background: rgba(0, 0, 0, 0.2);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-active, .badge-completed {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.badge-suspended, .badge-failed {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.badge-expired, .badge-pending {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.badge-solo {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-team {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.badge-enterprise {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* License Key Code block with copy */
.key-copy-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

.key-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #93c5fd;
  user-select: all;
}

.btn-copy {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  transition: var(--transition);
}

.btn-copy:hover {
  color: #fff;
  transform: scale(1.15);
}

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

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13.5px;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

/* iOS Style Switch Toggles */
.switch-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.switch-label-wrap strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-main);
}

.switch-label-wrap span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

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

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

input:checked + .slider-switch {
  background-color: var(--emerald);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--emerald);
  color: #fff;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11.5px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  animation: modalFadeIn 0.25s ease;
  overflow: hidden;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

/* Cyberpunk Login Screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #172554 0%, #090d16 80%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(19, 28, 49, 0.85);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(59, 130, 246, 0.15);
}

.login-brand-top {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 14px;
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.5);
}
