/* ═══════════════════════════════════════════════
   UltraText — app.css
   Mobile-first, fully responsive design system
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── CSS Variables ──────────────────────────── */
:root {
  --navy:         #0A1628;
  --navy-card:    #111E35;
  --navy-light:   #1A2B47;
  --navy-border:  #1E3A5F;
  --cyan:         #00BCD4;
  --cyan-hover:   #00ACC1;
  --cyan-muted:   rgba(0,188,212,0.12);
  --text-primary: #E8EDF5;
  --text-muted:   #8896AB;
  --success:      #00C853;
  --danger:       #F44336;
  --warning:      #FF9800;
  --sidebar-w:    240px;
  --topbar-h:     60px;
  --radius:       10px;
  --shadow:       0 2px 12px rgba(0,0,0,0.3);
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--navy-border); border-radius: 3px; }

/* ═══════════════════════════════════════════════
   AUTH LAYOUT
   ═══════════════════════════════════════════════ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: var(--navy);
}

.auth-card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--cyan);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--navy);
  font-size: 16px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: center;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; border-radius: 12px; }
  .auth-title { font-size: 20px; }
}

/* ═══════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════ */

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 98;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy-card);
  border-right: 1px solid var(--navy-border);
  display: flex;
  flex-direction: column;
  z-index: 99;
  overflow-y: auto;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  border-bottom: 1px solid var(--navy-border);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 30px;
  height: 30px;
  background: var(--cyan);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--navy);
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 14px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 0;
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--navy-light);
  text-decoration: none;
}

.nav-item.active {
  color: var(--cyan);
  background: var(--cyan-muted);
  border-left-color: var(--cyan);
  font-weight: 600;
}

.nav-item i { font-size: 16px; width: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.user-info { display: flex; align-items: center; gap: 10px; min-width: 0; }

.user-avatar {
  width: 34px;
  height: 34px;
  background: var(--cyan);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--navy);
  font-size: 13px;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--navy-card);
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 90;
  gap: 12px;
}

.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.topbar-hamburger:hover { background: var(--navy-light); }

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Mobile sidebar collapse ────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .topbar {
    left: 0;
    padding: 0 16px;
  }

  .topbar-hamburger { display: flex; align-items: center; }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }
}

/* ═══════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════ */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 480px) {
  .page-title { font-size: 18px; }
  .page-header.flex-between { align-items: flex-start; }
}

/* ═══════════════════════════════════════════════
   GRID SYSTEM
   ═══════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex { display: flex; align-items: center; }
.w-100 { width: 100%; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ═══════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════ */
.card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════ */
.stat-card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--cyan); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--cyan-muted);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-change { font-size: 11px; margin-top: 2px; }
.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

@media (max-width: 480px) {
  .stat-card { padding: 14px 12px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; font-size: 17px; }
  .stat-value { font-size: 20px; }
}

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: var(--cyan);
  color: var(--navy);
}
.btn-primary:hover { background: var(--cyan-hover); text-decoration: none; color: var(--navy); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--navy-light);
  color: var(--text-primary);
  border: 1px solid var(--navy-border);
}
.btn-secondary:hover { background: var(--navy-border); text-decoration: none; color: var(--text-primary); }

.btn-danger {
  background: rgba(244,67,54,0.12);
  color: var(--danger);
  border: 1px solid rgba(244,67,54,0.3);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Touch targets — minimum 44px on mobile */
@media (max-width: 768px) {
  .btn-primary,
  .btn-secondary,
  .btn-danger {
    padding: 11px 18px;
    min-height: 44px;
  }
  .btn-sm { padding: 8px 12px; min-height: 36px; }
}

/* ═══════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,188,212,0.12);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238896AB' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 100px; }

/* Bigger touch targets on mobile */
@media (max-width: 768px) {
  .form-control { padding: 12px 14px; font-size: 16px; } /* 16px prevents iOS zoom */
  textarea.form-control { font-size: 14px; }
}

/* Password toggle */
.input-wrap { position: relative; }
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  display: flex;
  align-items: center;
}

/* Search bar */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar input {
  width: 100%;
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: 8px;
  padding: 9px 14px 9px 36px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--cyan);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* Password strength */
.strength-bars {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.strength-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--navy-border);
  transition: background 0.3s;
}

.strength-bar.weak   { background: var(--danger); }
.strength-bar.fair   { background: var(--warning); }
.strength-bar.good   { background: #8BC34A; }
.strength-bar.strong { background: var(--success); }

/* ═══════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════ */
.table-wrapper {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Horizontal scroll on mobile */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px; /* prevents crushing on tiny screens */
}

thead tr {
  background: var(--navy-light);
  border-bottom: 1px solid var(--navy-border);
}

th {
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--navy-border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: rgba(255,255,255,0.02); }

/* Wrap table in scroll div in views */
@media (max-width: 768px) {
  .table-wrapper { border-radius: 8px; }
  th, td { padding: 10px 12px; }
  .table-wrapper table { min-width: 560px; }
}

/* ── Card-style rows on very small screens ── */
@media (max-width: 480px) {
  /* Apply .card-rows class to table for card layout */
  table.card-rows,
  table.card-rows thead { display: none; }

  table.card-rows tbody,
  table.card-rows tr,
  table.card-rows td { display: block; width: 100%; }

  table.card-rows tr {
    background: var(--navy-card);
    border: 1px solid var(--navy-border);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 14px;
  }

  table.card-rows td {
    padding: 4px 0;
    border: none;
    font-size: 13px;
  }

  table.card-rows td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 2px;
  }
}

/* ═══════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-active      { background: rgba(0,200,83,0.15);   color: var(--success); }
.badge-completed   { background: rgba(0,200,83,0.15);   color: var(--success); }
.badge-sent        { background: rgba(0,200,83,0.15);   color: var(--success); }
.badge-running     { background: rgba(0,188,212,0.15);  color: var(--cyan); }
.badge-scheduled   { background: rgba(255,152,0,0.15);  color: var(--warning); }
.badge-pending     { background: rgba(255,152,0,0.15);  color: var(--warning); }
.badge-draft       { background: rgba(136,150,171,0.15);color: var(--text-muted); }
.badge-failed      { background: rgba(244,67,54,0.15);  color: var(--danger); }
.badge-suspended   { background: rgba(244,67,54,0.15);  color: var(--danger); }
.badge-unsubscribed{ background: rgba(244,67,54,0.12);  color: var(--danger); }
.badge-bounced     { background: rgba(255,152,0,0.15);  color: var(--warning); }
.badge-processing  { background: rgba(0,188,212,0.12);  color: var(--cyan); }
.badge-starter     { background: rgba(136,150,171,0.15);color: var(--text-muted); }
.badge-growth      { background: rgba(0,188,212,0.15);  color: var(--cyan); }
.badge-enterprise  { background: rgba(156,39,176,0.15); color: #CE93D8; }

/* ═══════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-success { background: rgba(0,200,83,0.1);  border: 1px solid rgba(0,200,83,0.3);  color: var(--success); }
.alert-error   { background: rgba(244,67,54,0.1); border: 1px solid rgba(244,67,54,0.3); color: var(--danger); }
.alert-warning { background: rgba(255,152,0,0.1); border: 1px solid rgba(255,152,0,0.3); color: var(--warning); }
.alert-info    { background: var(--cyan-muted);   border: 1px solid rgba(0,188,212,0.3); color: var(--cyan); }

/* ═══════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(3px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.modal-title { font-size: 16px; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: -2px;
}

.modal-close:hover { color: var(--text-primary); }

/* Full-screen modals on mobile */
@media (max-width: 600px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    padding: 20px 16px;
  }
}

/* ═══════════════════════════════════════════════
   DRAWERS
   ═══════════════════════════════════════════════ */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
  backdrop-filter: blur(2px);
}

.drawer-overlay.open { display: block; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: var(--navy-card);
  border-left: 1px solid var(--navy-border);
  padding: 24px 20px;
  overflow-y: auto;
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
  animation: drawerIn 0.25s ease;
  z-index: 151;
}

@keyframes drawerIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--navy-border);
}

/* Full width drawer on mobile */
@media (max-width: 480px) {
  .drawer { width: 100%; border-left: none; }
}

/* ═══════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--navy-border);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--cyan); border-bottom-color: var(--cyan); font-weight: 600; }

/* ═══════════════════════════════════════════════
   PROGRESS BARS
   ═══════════════════════════════════════════════ */
.progress-wrap { margin-bottom: 4px; }

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-bar-track {
  height: 6px;
  background: var(--navy-light);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--cyan);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-bar-fill.danger  { background: var(--danger); }
.progress-bar-fill.warning { background: var(--warning); }

/* ═══════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state i {
  font-size: 40px;
  color: var(--cyan);
  display: block;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════
   FILTER BARS
   ═══════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar .form-control { width: auto; }

@media (max-width: 600px) {
  .filter-bar { flex-direction: column; }
  .filter-bar .form-control,
  .filter-bar .search-bar { width: 100%; }
}

/* ═══════════════════════════════════════════════
   BOTTOM NAV (Mobile only)
   ═══════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy-card);
  border-top: 1px solid var(--navy-border);
  z-index: 95;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.15s;
  min-width: 56px;
}

.bottom-nav-item i { font-size: 20px; }
.bottom-nav-item.active { color: var(--cyan); }
.bottom-nav-item:hover { color: var(--text-primary); text-decoration: none; }

@media (max-width: 768px) {
  .bottom-nav { display: block; }
  /* Add padding so content isn't hidden behind bottom nav */
  .main-content { padding-bottom: 80px; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE UTILITIES
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* ═══════════════════════════════════════════════
   CAMPAIGN STEP DOTS
   ═══════════════════════════════════════════════ */
.step-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}

.step-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--navy-border);
  transition: background 0.3s;
}

.step-dot.active { background: var(--cyan); }

/* ═══════════════════════════════════════════════
   CODE / MONOSPACE
   ═══════════════════════════════════════════════ */
code {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: var(--navy-light);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════
   ADMIN PANEL OVERRIDES
   ═══════════════════════════════════════════════ */
.admin-sidebar .sidebar-logo-icon { background: #9C27B0; }
.admin-sidebar .nav-item.active   { color: #CE93D8; background: rgba(156,39,176,0.12); border-left-color: #9C27B0; }
.admin-sidebar .user-avatar       { background: #9C27B0; }

/* ═══════════════════════════════════════════════
   SAFE AREA (iPhone notch / home bar)
   ═══════════════════════════════════════════════ */
@supports (padding: max(0px)) {
  .topbar { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
  .main-content { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

/* ═══════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .bottom-nav, .btn-primary, .btn-secondary { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  body { background: white; color: black; }
}

/* ── Append these to the bottom of app.css ── */

/* Mobile topbar */
.mobile-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--navy-card);
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  z-index: 90;
}

.mobile-topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.mobile-help-btn {
  background: var(--navy-light);
  border: 1px solid var(--navy-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
}

.mobile-help-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

/* Desktop floating help button */
.floating-help {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  color: var(--text-muted);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 80;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: all 0.2s;
}

.floating-help:hover {
  background: var(--cyan);
  color: var(--navy);
  border-color: var(--cyan);
  transform: scale(1.08);
}

/* Desktop topbar — no hamburger needed */
.topbar { justify-content: flex-start; }

/* On mobile, main content sits below mobile topbar */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    margin-top: var(--topbar-h);
    padding: 16px 16px 90px;
  }
}