/*
 * Y3Data V1 - Dashboard & Admin UI Components Style Suite
 */

/* Dashboard Layout Structure */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-secondary);
}

.dashboard-main-content {
  flex-grow: 1;
  padding: 2rem 2.5rem;
  margin-left: 280px;
  width: calc(100% - 280px);
  transition: all 0.3s ease;
}

@media (max-width: 992px) {
  .dashboard-main-content {
    margin-left: 0;
    width: 100%;
    padding: 1.5rem 1rem;
  }
}

/* Sidebar Styling */
.dashboard-sidebar {
  width: 280px;
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1020;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.25rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 992px) {
  .dashboard-sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }

  .dashboard-sidebar.open {
    transform: translateX(0);
  }
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
}

@media (max-width: 992px) {
  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Sidebar Backdrop Overlay on Mobile */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1010;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Mobile Sidebar Toggle Button for Topbar */
.sidebar-toggle-btn {
  display: none;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background-color: var(--bg-tertiary);
}

@media (max-width: 992px) {
  .sidebar-toggle-btn {
    display: inline-flex;
  }
}

.sidebar-brand {
  margin-bottom: 2rem;
  padding-left: 0.5rem;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 2rem;
}

.user-avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

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

.user-display-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar-menu-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-group-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-left: 0.5rem;
  margin-bottom: 0.5rem;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  transition: stroke 0.2s ease;
}

.sidebar-nav-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.sidebar-nav-item.active svg {
  stroke: #ffffff;
}

/* Ultra-Smooth Enterprise Collapsible Dropdown Accordion Sidebar */
.sidebar-dropdown {
  position: relative;
  list-style: none;
}

.sidebar-dropdown-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  text-align: left;
  user-select: none;
}

.sidebar-dropdown-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar-dropdown.open > .sidebar-dropdown-btn,
.sidebar-dropdown.active > .sidebar-dropdown-btn {
  color: var(--primary);
  font-weight: 600;
  background-color: var(--bg-secondary);
}

.sidebar-dropdown-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-dropdown-label svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2px;
}

.dropdown-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
}

.sidebar-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

/* Smooth Accordion Submenu Slide Animation */
.sidebar-submenu {
  list-style: none;
  padding: 0.25rem 0 0.25rem 0.25rem;
  margin: 0 0 0 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-left: 2px solid var(--border-color);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
}

.sidebar-dropdown.open .sidebar-submenu {
  max-height: 500px;
  opacity: 1;
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

.sidebar-subitem {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, border-left 0.2s ease;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.sidebar-subitem:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  transform: translateX(3px);
}

.sidebar-subitem.active {
  color: var(--primary);
  font-weight: 600;
  background-color: rgba(37, 99, 235, 0.09);
  border-left: 3px solid var(--primary);
  padding-left: 0.95rem;
}

.sidebar-footer-action {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Dashboard Top Header Bar */
.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.dashboard-page-title h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.dashboard-page-title p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Balance Hero Card */
.balance-hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
  color: #ffffff;
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.balance-hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.balance-card-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

@media (max-width: 768px) {
  .balance-card-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.balance-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.balance-label-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0.85;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.balance-amount-display {
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.balance-actions-row {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Virtual Bank Account Pill Box */
.virtual-accounts-box {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.virtual-acc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.acc-bank-name {
  font-weight: 600;
  opacity: 0.85;
}

.acc-number-code {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.acc-number-code:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Service Quick Grid */
.services-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.service-quick-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.service-quick-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.service-quick-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background-color: var(--primary-light-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-quick-icon svg {
  width: 24px;
  height: 24px;
}

.service-quick-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Card Wrapper Utilities */
.fintech-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.fintech-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.fintech-card-title {
  font-size: 1.15rem;
  font-weight: 700;
}

/* Table Design */
.fintech-table-wrapper {
  overflow-x: auto;
}

.fintech-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.fintech-table th {
  padding: 0.85rem 1rem;
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.fintech-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.fintech-table tbody tr:hover {
  background-color: var(--bg-tertiary);
}

/* Status Badges */
.badge-subtle-success {
  background-color: var(--success-bg);
  color: var(--success);
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.badge-subtle-warning {
  background-color: var(--warning-bg);
  color: var(--warning);
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.badge-subtle-danger {
  background-color: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.badge-subtle-primary {
  background-color: var(--primary-light-bg);
  color: var(--primary);
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

/* Form Components */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control, .form-select {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Admin UI Typography Refinement (Less bold, smaller elegant text) */
body.admin-page,
.dashboard-main-content h1,
.dashboard-main-content h2,
.dashboard-main-content h3,
.dashboard-main-content h4 {
  font-weight: 600 !important;
}

.dashboard-page-title h1 {
  font-size: 1.35rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
}

.dashboard-page-title p {
  font-size: 0.825rem !important;
  color: var(--text-muted);
}

.fintech-card-title {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
}

.fintech-card div[style*="font-size: 2rem"] {
  font-size: 1.45rem !important;
  font-weight: 700 !important;
}

.fintech-table th {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fintech-table td {
  font-size: 0.85rem !important;
  font-weight: 400 !important;
}

.fintech-table td strong {
  font-weight: 500 !important;
}

.badge {
  font-weight: 500 !important;
}
