/* ==========================================================================
   soulguidedbymansi - Admin Panel Stylesheet (Golden Earth Theme)
   ========================================================================== */

:root {
  --ivory: #fbf6ed;
  --cream: #f3e5d0;
  --gold: #b47a18;
  --gold-light: #d8ad55;
  --earth: #7b4d17;
  --earth-dark: #4b2e12;
  --brown: #30251d;
  --muted: #67584a;
  --line: #dfc69f;
  --white: #ffffff;
  --success: #2e7d32;
  --success-bg: #e8f5e9;
  --danger: #c62828;
  --danger-bg: #ffebee;
  --warning: #ef6c00;
  --warning-bg: #fff3e0;
  --sidebar-w: 260px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #f8f4ec;
  color: var(--brown);
  font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--earth);
  text-decoration: none;
}

a:hover {
  color: var(--earth-dark);
}

/* Layout */
.admin-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--earth-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold);
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #fff;
}

.sidebar-title {
  font-family: Georgia, serif;
  font-size: 17px;
  color: #f1cd79;
  line-height: 1.2;
}

.sidebar-sub {
  font-size: 10px;
  letter-spacing: 2px;
  color: #d1bca4;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 14px 0 24px 0;
  flex: 1;
}

.sidebar-group {
  margin-bottom: 8px;
}

.sidebar-group-title {
  padding: 14px 22px 5px 22px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #d1bca4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  color: #e5d5c5;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: rgba(180, 122, 24, 0.25);
  color: #f1cd79;
  border-left-color: var(--gold-light);
  font-weight: 600;
}

.nav-icon {
  font-size: 17px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 18px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  color: #b7a491;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Main Content Area */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.page-heading {
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--earth-dark);
}

.ist-badge {
  background: #fdf5e6;
  border: 1px solid var(--line);
  color: var(--earth);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.view-site-btn {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--earth);
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.2s;
}

.view-site-btn:hover {
  background: var(--cream);
  color: var(--earth-dark);
}

/* Content Body */
.admin-content {
  padding: 30px;
  flex: 1;
}

/* Alerts */
.alert {
  padding: 13px 18px;
  border-radius: 6px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid #a5d6a7;
  color: var(--success);
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid #ef9a9a;
  color: var(--danger);
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid #ffe082;
  color: var(--warning);
}

/* Cards & Panels */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(100, 60, 20, 0.04);
  margin-bottom: 25px;
  overflow: hidden;
}

.panel-header {
  padding: 16px 22px;
  background: #faf5ec;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--earth-dark);
}

.panel-body {
  padding: 22px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--cream);
  color: var(--earth);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.stat-number {
  font-size: 24px;
  font-weight: bold;
  color: var(--brown);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #faf5ec;
  color: var(--earth-dark);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 2px solid var(--line);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0e6d6;
  vertical-align: middle;
  font-size: 13.5px;
}

.data-table tr:hover td {
  background: #fdfaf3;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-active {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #c8e6c9;
}

.badge-inactive {
  background: #f5f5f5;
  color: #757575;
  border: 1px solid #e0e0e0;
}

.badge-pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #ffe082;
}

.badge-confirmed {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
}

.badge-completed {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #c8e6c9;
}

.badge-cancelled {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #ffcdd2;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--earth-dark);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--brown);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(180, 122, 24, 0.15);
}

textarea {
  min-height: 85px;
  resize: vertical;
}

/* Buttons */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--earth);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-admin:hover {
  background: var(--earth-dark);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--earth);
}

.btn-secondary:hover {
  background: var(--cream);
  color: var(--earth-dark);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #b71c1c;
}

.btn-sm {
  padding: 4px 9px;
  font-size: 11.5px;
}

.action-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: grid;
}

.modal-content {
  background: var(--white);
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin: auto;
  overflow: hidden;
}

.modal-header {
  padding: 16px 22px;
  background: #faf5ec;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: Georgia, serif;
  font-size: 18px;
  color: var(--earth-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
}

.modal-body {
  padding: 22px;
  max-height: 80vh;
  overflow-y: auto;
}

/* Submenu indentation */
.submenu-row td:first-child {
  padding-left: 32px;
  position: relative;
}

.submenu-indent {
  color: var(--gold);
  margin-right: 6px;
}

/* ==========================================================================
   Subtabs & Settings Component Styling
   ========================================================================== */
.subtabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 0;
  overflow-x: auto;
}

.subtab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  bottom: -2px;
}

.subtab-item:hover {
  color: var(--earth-dark);
  background: rgba(243, 229, 208, 0.4);
}

.subtab-item.active {
  color: var(--earth-dark);
  background: var(--white);
  border-color: var(--line);
  border-bottom: 2px solid var(--white);
  color: var(--earth);
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.03);
}

.subtab-badge {
  background: var(--cream);
  color: var(--earth-dark);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
}

.subtab-item.active .subtab-badge {
  background: var(--gold);
  color: #fff;
}

/* Gateway Cards */
.gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  margin-bottom: 24px;
}

.gateway-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

.gateway-card-header {
  padding: 16px 20px;
  background: #faf6f0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gateway-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: bold;
  color: var(--earth-dark);
}

.gateway-icon {
  font-size: 20px;
  display: inline-block;
}

.gateway-card-body {
  padding: 20px;
}

/* Switch Toggle */
.switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--gold);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Logo Upload & Preview Box */
.logo-preview-box {
  background: #fbf8f2;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.logo-preview-img {
  max-height: 80px;
  max-width: 100%;
  object-fit: contain;
}

.logo-preview-dark {
  background: #30251d;
  color: #fff;
}

/* Transaction Detail Grid */
.txn-detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 16px;
  font-size: 13.5px;
  line-height: 1.6;
}

.txn-detail-label {
  font-weight: 600;
  color: var(--muted);
}

.txn-detail-val {
  color: var(--brown);
  word-break: break-all;
}

.code-block {
  background: #2b2520;
  color: #f1cd79;
  padding: 12px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

/* Subtabs Navigation Buttons */
.subtabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.subtab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--earth);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.subtab-item:hover {
  background: var(--cream);
  color: var(--earth-dark);
  border-color: var(--gold-light);
}

.subtab-item.active {
  background: var(--earth);
  color: #ffffff;
  border-color: var(--earth-dark);
}

.subtab-badge {
  background: var(--cream);
  color: var(--earth-dark);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.subtab-item.active .subtab-badge {
  background: #ffffff;
  color: var(--earth-dark);
}

/* Admin Modals */
.admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.modal-content {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f7efe1, #faf4e9);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.modal-title {
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--earth-dark);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--earth-dark);
  line-height: 1;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #faf6f0;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}

/* Responsive */
@media (max-width: 900px) {
  .admin-sidebar {
    width: 70px;
  }
  .sidebar-header .sidebar-title,
  .sidebar-header .sidebar-sub,
  .nav-item span,
  .sidebar-footer {
    display: none;
  }
  .admin-main {
    margin-left: 70px;
  }
  .nav-item {
    justify-content: center;
    padding: 15px 0;
  }
  .gateway-grid {
    grid-template-columns: 1fr;
  }
}
