@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --primary-green: #37c876;
  --primary-green-dark: #22a75d;
  --primary-green-light: #5de097;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #0b1120;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  padding: 24px 20px 60px;
  background-image: 
    radial-gradient(at 10% 10%, rgba(55, 200, 118, 0.12) 0px, transparent 40%),
    radial-gradient(at 90% 90%, rgba(34, 167, 93, 0.08) 0px, transparent 50%);
}

.admin-container {
  max-width: 1080px;
  margin: 0 auto;
}

/* Header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 16px;
}

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

.brand-sphere {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8ef5be 0%, #30c473 45%, #188d4d 100%);
  box-shadow: 0 0 12px rgba(55, 200, 118, 0.5);
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-badge {
  background: rgba(55, 200, 118, 0.15);
  color: var(--primary-green);
  border: 1px solid rgba(55, 200, 118, 0.3);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.btn-link-dashboard {
  background: var(--primary-green);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(55, 200, 118, 0.3);
}

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

/* Alert Notification */
.alert-box {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

.alert-success {
  background: rgba(22, 163, 74, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grid Layout */
.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

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

/* Cards */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  margin-bottom: 24px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title svg {
  stroke: var(--primary-green);
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-prefix {
  position: absolute;
  left: 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
  color: #ffffff;
  font-size: 15px;
  font-family: var(--font-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-icon .form-input {
  padding-left: 32px;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-display);
}

.form-input:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(55, 200, 118, 0.2);
}

.form-help {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}

/* Presets */
.preset-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset:hover {
  background: rgba(55, 200, 118, 0.2);
  border-color: var(--primary-green);
  color: #4ade80;
}

/* Switch Toggle */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-input);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.switch-label-group {
  display: flex;
  flex-direction: column;
}

.switch-label-title {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
}

.switch-label-desc {
  font-size: 12px;
  color: var(--text-muted);
}

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

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #475569;
  transition: 0.3s;
  border-radius: 26px;
}

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

input:checked + .slider {
  background-color: var(--primary-green);
}

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

/* Submit Actions */
.btn-save-admin {
  width: 100%;
  background: var(--primary-green);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(55, 200, 118, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn-save-admin:active {
  transform: scale(0.99);
}

/* Live Simulation Card in Admin */
.preview-mini-card {
  background: linear-gradient(175deg, #44cf7f 0%, #5ddc92 50%, #7ee7a9 100%);
  border-radius: 20px;
  padding: 20px;
  color: #ffffff;
  text-align: center;
  box-shadow: 0 10px 25px rgba(34, 167, 93, 0.3);
  margin-bottom: 20px;
}

.preview-sub {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 6px;
}

.preview-amount {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.preview-lbl {
  font-size: 12px;
  opacity: 0.9;
}

/* Transaction Manager in Admin */
.tx-admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 13.5px;
}

.tx-admin-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.tx-admin-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.tx-amount-badge {
  font-weight: 700;
  font-family: var(--font-display);
}

.tx-amount-badge.credit {
  color: #4ade80;
}

.tx-amount-badge.debit {
  color: #f87171;
}

.btn-icon-delete {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-icon-delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Raw DB viewer */
.code-viewer {
  background: #020617;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  color: #38bdf8;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
