/* Dashboard Layout & Styling matching the premium 'PAYOPIE' interface */

body.dashboard-body-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow-x: hidden;
}

/* Color Overrides / Extras */
.text-teal { color: #0ed3c6 !important; }
.bg-teal { background-color: #0ed3c6 !important; }

/* Sidebar */
.sidebar-navigation {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  padding: 24px 16px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 35px;
  padding-left: 12px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.section-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  padding-left: 12px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: rgba(14, 211, 198, 0.08);
  color: #0ed3c6;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 4px;
  background-color: #0ed3c6;
  border-radius: 0 4px 4px 0;
}

.live-pill {
  background: rgba(14, 211, 198, 0.15);
  color: #0ed3c6;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: auto;
  border: 1px solid rgba(14, 211, 198, 0.25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.demo-store-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.demo-store-link:hover {
  background: rgba(99, 102, 241, 0.2);
  color: white;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-color);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Layout Wrapper */
.main-layout-wrapper {
  margin-left: 260px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: 80px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar-wrapper i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
}

.search-bar-wrapper input {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 10px 16px 10px 40px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  width: 260px;
  transition: var(--transition);
}

.search-bar-wrapper input:focus {
  outline: none;
  border-color: #0ed3c6;
  width: 320px;
}

.action-icon-btn {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.action-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

/* Content Container */
.content-container {
  padding: 32px;
  flex-grow: 1;
  overflow-y: auto;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Premium Stat Cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card-premium {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.stat-card-premium:hover {
  border-color: rgba(14, 211, 198, 0.3);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.stat-card-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.stat-number {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-heading);
}

.stat-trend {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.icon-cyan { background-color: rgba(14, 211, 198, 0.1); color: #0ed3c6; }
.icon-yellow { background-color: rgba(255, 179, 0, 0.1); color: #ffb300; }
.icon-orange { background-color: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.icon-teal { background-color: rgba(38, 161, 123, 0.1); color: #26a17b; }

/* Dashboard Split Grid */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1100px) {
  .dashboard-split-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card-large {
  padding: 24px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-range-selector {
  display: flex;
  background-color: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.range-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.range-btn.active {
  background-color: #0ed3c6;
  color: var(--bg-primary);
}

.chart-wrapper-main {
  height: 280px;
  position: relative;
}

/* Top Merchants list */
.top-merchants-card {
  padding: 24px;
}

.merchants-rank-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.merchant-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.merchant-rank-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.rank-1 { background-color: rgba(14, 211, 198, 0.15); color: #0ed3c6; border: 1px solid #0ed3c6; }
.rank-2 { background-color: rgba(255, 179, 0, 0.15); color: #ffb300; border: 1px solid #ffb300; }
.rank-3 { background-color: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid #f59e0b; }
.rank-other { background-color: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid var(--border-color); }

.merchant-rank-info {
  flex-grow: 1;
}

.merchant-rank-name {
  font-size: 14px;
  font-weight: 600;
  display: block;
}

.merchant-rank-txs {
  font-size: 11px;
  color: var(--text-muted);
}

.merchant-rank-volume {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-heading);
}

/* Filter Bar styles */
.filter-bar-wrapper {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  align-items: center;
}

@media (max-width: 768px) {
  .filter-bar-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
}

/* UPI Channels Styling */
.upi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.upi-channel-card {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.upi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upi-card-icon {
  font-size: 24px;
  color: #ff9800;
}

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

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

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .4s;
  border-radius: 34px;
}

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

input:checked + .slider-toggle {
  background-color: #0ed3c6;
}

input:checked + .slider-toggle:before {
  transform: translateX(18px);
}

.upi-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upi-data-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.upi-data-label {
  color: var(--text-muted);
}

.upi-data-value {
  font-weight: 500;
  color: var(--text-primary);
}

/* System Logs Console styling */
.logs-console {
  background-color: #030406;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  color: #a7f3d0;
  max-height: 550px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-line {
  line-height: 1.6;
}

.log-timestamp {
  color: #34d399;
}

.log-method-get { color: #38bdf8; font-weight: bold; }
.log-method-post { color: #a78bfa; font-weight: bold; }
.log-status-200 { color: #34d399; }
.log-status-error { color: #f87171; }

/* Credential Styling for Dashboard */
.credential-box {
  background-color: var(--bg-primary);
  font-weight: 600;
}

/* --- Light Theme Overrides --- */
body.light-theme .nav-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

body.light-theme .action-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .merchant-rank-item {
  background-color: rgba(0, 0, 0, 0.02);
}

body.light-theme .merchant-rank-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .rank-other {
  background-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .demo-store-link {
  background: rgba(99, 102, 241, 0.05);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.3);
}

body.light-theme .demo-store-link:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-hover);
}


/* Custom Button extensions for Payout action controls */
.btn-success {
  background-color: #10b981;
  color: white;
}
.btn-success:hover {
  background-color: #059669;
}
.btn-danger {
  background-color: #ef4444;
  color: white;
}
.btn-danger:hover {
  background-color: #dc2626;
}
.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}
.btn-block {
  width: 100%;
}
.text-rose {
  color: #f43f5e !important;
}

/* Modal Overlays & Centered Cards */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 11, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-modal {
  width: 90%;
  max-width: 500px;
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Specific Full-Screen panel layout for Agent Modal as requested */
#agent-modal {
  background-color: var(--bg-primary);
  backdrop-filter: blur(20px);
}

#agent-modal .checkout-modal {
  width: 100%;
  height: 100%;
  max-width: 100%;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  background-color: transparent;
}

#agent-modal .checkout-modal > h2,
#agent-modal .checkout-modal > .divider,
#agent-modal .checkout-modal > .form-group,
#agent-modal .checkout-modal > button {
  width: 100%;
  max-width: 500px; /* Center container content */
}
