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

:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #172033;
  background: #edf2fa;
}

body {
  min-height: 100vh;
  background: linear-gradient(120deg, #eef3fb, #e5edf8);
}

/* Top navigation */

.topbar {
  min-height: 94px;
  padding: 18px 25px;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid #e2e8f1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: #3478f6;
  color: white;
  display: grid;
  place-items: center;
  font-size: 30px;
  box-shadow: 0 4px 14px #3478f644;
}

.brand h2 {
  font-size: 23px;
  margin-bottom: 5px;
}

.brand p {
  color: #71809a;
  font-size: 16px;
}

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

button {
  cursor: pointer;
  font: inherit;
}

.admin-button {
  background: white;
  border: 1px solid #dce3ed;
  padding: 12px 18px;
  border-radius: 8px;
  color: #172033;
  font-weight: 600;
}

.icon-button {
  border: none;
  background: transparent;
  padding: 10px;
  font-size: 20px;
  color: #64748b;
}

/* Main dashboard */

.dashboard {
  padding: 26px 22px 50px;
}

/* Search and filters */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

#searchInput {
  width: 370px;
  max-width: 100%;
  padding: 14px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  outline: none;
}

#searchInput:focus {
  border-color: #3478f6;
}

.filters {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid #e0e6ef;
  border-radius: 10px;
}

.filter-icon {
  padding: 0 10px;
  color: #64748b;
}

.filter-button {
  border: none;
  background: transparent;
  color: #71809a;
  padding: 9px 14px;
  border-radius: 8px;
}

.filter-button.active {
  background: #2866ed;
  color: white;
}

/* Campaign cards */

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.campaign-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e1e8f1;
  border-radius: 16px;
  padding: 15px;
  min-height: 162px;
  box-shadow: 0 2px 3px #17203308;
}

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

.status-badge {
  background: #2866ed;
  color: white;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 20px;
}

.status-badge.inactive {
  background: #9aa4b4;
}

.view-campaign {
  display: inline-block;
  margin-top: 8px;
  color: #71809a;
  font-size: 14px;
  text-decoration: none;
}

.view-campaign:hover {
  color: #2866ed;
}

.quest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-bottom: 9px;
  border-bottom: 1px solid #edf0f5;
  color: #71809a;
  font-size: 14px;
}

.quest-count {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quest-number {
  background: #2866ed;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
}

.auto-check-row {
  display: flex;
  justify-content: space-between;
  margin-top: 13px;
  color: #71809a;
  font-size: 13px;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}

.card-actions button {
  background: #f1f5fb;
  border: 1px solid #e1e8f1;
  border-radius: 6px;
  padding: 6px 10px;
  color: #52627a;
  font-size: 12px;
}

/* Empty state */

.empty-state,
.telemetry-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 65px 20px;
  color: #71809a;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 14px;
}

.empty-state h3 {
  color: #172033;
  margin-bottom: 10px;
}

/* Telemetry */

.telemetry-section {
  margin-top: 90px;
  padding-top: 28px;
  border-top: 1px solid #e0e7f1;
}

.telemetry-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.telemetry-heading h3 {
  color: #8090a9;
  font-size: 13px;
  letter-spacing: 2px;
}

.telemetry-legend {
  display: flex;
  gap: 18px;
  color: #71809a;
  font-size: 12px;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.telemetry-card {
  min-width: 0;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #dce5f2;
  border-radius: 16px;
  padding: 18px;
  min-height: 120px;
}

.telemetry-card h4 {
  margin-bottom: 15px;
}

.telemetry-card p {
  color: #71809a;
  font-size: 13px;
}

/* Add campaign modal */

.modal {
  position: fixed;
  inset: 0;
  background: #17203388;
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10;
}

.modal[hidden] {
  display: none;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 440px;
  padding: 28px;
  border-radius: 14px;
}

.modal-content h2 {
  margin-bottom: 10px;
}

.modal-content p {
  color: #71809a;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-content label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.modal-content input {
  width: 100%;
  padding: 13px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions button {
  padding: 11px 16px;
  border: none;
  border-radius: 7px;
  background: #2866ed;
  color: white;
}

.modal-actions button:last-child {
  background: #e9edf4;
  color: #172033;
}

/* Smaller screens */

@media (max-width: 1000px) {
  .campaign-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .telemetry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .topbar,
  .toolbar,
  .telemetry-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand p {
    font-size: 13px;
  }

  .dashboard {
    padding: 18px 12px;
  }

  .campaign-grid,
  .telemetry-grid {
    grid-template-columns: 1fr;
  }

  #searchInput {
    width: 100%;
  }
}

/* =================================
   CAMPAIGN CARD IMPROVEMENTS
================================= */

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  align-items: stretch;
}

.campaign-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
  min-width: 0;
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.campaign-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(30, 64, 175, 0.09);
}

.campaign-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.campaign-card-header h3 {
  margin: 0;
  color: #172554;
  font-size: 19px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.active {
  background: #dcfce7;
  color: #15803d;
}

.status-badge.inactive {
  background: #f1f5f9;
  color: #64748b;
}

.campaign-card > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: #2563eb;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.campaign-card > a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.quest-count {
  margin: 0;
  padding: 13px 14px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.scan-info {
  margin: -5px 0 0;
  color: #94a3b8;
  font-size: 12px;
}

.campaign-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid #edf2f7;
}

.campaign-admin-actions button {
  padding: 8px 13px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.campaign-admin-actions button:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.campaign-admin-actions button[data-action="delete"] {
  color: #dc2626;
  border-color: #fecaca;
}

.campaign-admin-actions button[data-action="delete"]:hover {
  background: #fef2f2;
}

/* =================================
   ADD CAMPAIGN BUTTON
================================= */

#addCampaignButton {
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.18);
}

#addCampaignButton:hover {
  background: #1d4ed8;
}

/* =================================
   RESPONSIVE CAMPAIGN CARDS
================================= */

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

  .campaign-card {
    padding: 18px;
  }

  .campaign-card-header h3 {
    font-size: 17px;
  }
}
`
/* =================================
   TELEMETRY DASHBOARD IMPROVEMENTS
================================= */

.telemetry-section {
  margin-top: 65px;
  padding-top: 32px;
  border-top: 1px solid #dce5f2;
}

.telemetry-heading {
  margin-bottom: 24px;
}

.telemetry-heading h3 {
  color: #172554;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.telemetry-card {
  position: relative;
  min-width: 0;
  padding: 22px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.telemetry-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(30, 64, 175, 0.09);
}

.telemetry-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid #edf2f7;
}

.telemetry-card-header h3 {
  color: #172554;
  font-size: 17px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Scan status indicators */

.telemetry-card .status-badge.success {
  background: #dcfce7;
  color: #15803d;
}

.telemetry-card .status-badge.error {
  background: #fee2e2;
  color: #b91c1c;
}

.telemetry-card .status-badge.pending {
  background: #f1f5f9;
  color: #64748b;
}

/* Telemetry information rows */

.telemetry-card p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.telemetry-card p strong {
  color: #172554;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

/* Responsive telemetry */

@media (max-width: 650px) {
  .telemetry-section {
    margin-top: 45px;
    padding-top: 24px;
  }

  .telemetry-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .telemetry-card {
    padding: 18px;
  }

  .telemetry-card-header h3 {
    font-size: 16px;
  }
}

/* Correct existing campaign button transition */

.campaign-admin-actions button {
  transition: background 0.2s ease, border-color 0.2s ease;
}

/* =================================
   NOTIFICATION DROPDOWN
================================= */

.notification-wrapper {
  position: relative;
}

#notificationButton {
  position: relative;
  font-size: 23px;
}

.notification-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid white;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: 440px;
  overflow-y: auto;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.15);
  z-index: 20;
}

.notification-panel[hidden] {
  display: none;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 17px;
  border-bottom: 1px solid #edf2f7;
}

.notification-panel-header h3 {
  color: #172554;
  font-size: 16px;
}

#markNotificationsReadButton {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.notification-list {
  display: flex;
  flex-direction: column;
}

.notification-item {
  padding: 16px;
  border-bottom: 1px solid #edf2f7;
  text-decoration: none;
  color: inherit;
  display: block;
}

.notification-item:hover {
  background: #f8fafc;
}

.notification-item.unread {
  background: #eff6ff;
}

.notification-item h4 {
  color: #172554;
  font-size: 14px;
  margin-bottom: 7px;
  overflow-wrap: anywhere;
}

.notification-item p {
  color: #64748b;
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.5;
}

.notification-item .notification-time {
  color: #94a3b8;
  font-size: 11px;
}

.notification-empty {
  padding: 30px 15px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

@media (max-width: 500px) {
  .notification-panel {
    right: -5px;
  }
}
