.hidden { display: none !important; }

.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-box {
  background: #121a32;
  padding: 2rem;
  border-radius: 14px;
  width: 100%;
  max-width: 350px;
  text-align: center;
  border: 1px solid #263252;
}

.login-box h2 { margin-bottom: 1.5rem; color: #fff; }
.login-box input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  background: #0f172a;
  border: 1px solid #334155;
  color: #fff;
  border-radius: 10px;
}
.login-box button {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(125deg, #7c3aed, #06b6d4);
  border: none;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  border-radius: 10px;
}
.login-box .error { color: #ff4d4d; margin-top: 1rem; font-size: 0.9rem; }

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: #0b1020;
  color: #e2e8f0;
}
.admin-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.switch-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}

.switch-wrap input {
  display: none;
}

.slider {
  width: 40px;
  height: 20px;
  background-color: #334155;
  border-radius: 20px;
  position: relative;
  transition: .4s;
}

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

input:checked + .slider {
  background-color: #10b981;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.stats-cards .card {
  border-left: 4px solid #7c3aed;
}

/* Toast Notifications */
#notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
  cursor: pointer;
}

.toast.success { border-left: 4px solid #10b981; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid #3b82f6; }

.toast.hiding {
  animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal-content {
  background: #121a32;
  border: 1px solid #263252;
  border-radius: 14px;
  padding: 20px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.close-modal {
  font-size: 28px;
  cursor: pointer;
  color: #94a3b8;
}
.user-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}
.info-item label { color: #94a3b8; font-size: 12px; display: block; }
.info-item span { font-weight: bold; }

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.input-group label {
  font-size: 12px;
  color: #94a3b8;
}

.filters select {
  background: #0f172a;
  color: #fff;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px;
}
h1,
h2 {
  margin: 0;
}
button {
  border: none;
  background: linear-gradient(125deg, #7c3aed, #06b6d4);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.card {
  background: #121a32;
  border: 1px solid #263252;
  border-radius: 14px;
  padding: 12px;
}
.card p {
  margin: 0;
  color: #94a3b8;
}
.card h3 {
  margin: 8px 0 0;
  font-size: 22px;
}
.panel {
  background: #121a32;
  border: 1px solid #263252;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.wallet-row, .row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
input {
  flex: 1;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
}
.table-wrap {
  overflow-x: auto;
  margin-top: 10px;
  background: #121a32;
  border: 1px solid #263252;
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 800px;
}
th,
td {
  border: 1px solid #2b3655;
  padding: 8px;
  text-align: left;
}
th {
  background: #1e293b;
}
#walletMessage {
  color: #86efac;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  padding: 10px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 6px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  background: #334155;
}

.pagination button.active {
  background: linear-gradient(125deg, #7c3aed, #06b6d4);
  border-color: transparent;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination span {
  align-self: center;
  color: #64748b;
}

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

@media (max-width: 640px) {
  .admin-wrap {
    padding: 10px;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .row, .wallet-row {
    flex-direction: column;
  }

  .row button, .wallet-row button, .row input, .wallet-row input, .row select {
    width: 100%;
  }

  .input-group {
    width: 100%;
    flex: none;
  }

  .user-info-grid {
    grid-template-columns: 1fr;
  }

  .login-box {
    width: 90%;
    margin: 20px;
  }
}

@media (max-width: 400px) {
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions button {
    width: 100%;
  }
}
