/* assets/css/dashboard.css - Light Luxury Client & Admin Portal Styling */

.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: #f8fafc;
  color: #0b0f19;
}

/* Sidebar */
.dash-sidebar {
  width: 275px;
  background: #ffffff;
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
  height: 84px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.sidebar-nav {
  padding: 24px 16px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
  padding: 14px 12px 6px 12px;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.dash-nav-item:hover {
  color: #c59b27;
  background: rgba(197, 155, 39, 0.06);
}

.dash-nav-item.active {
  color: #9a7615;
  background: rgba(197, 155, 39, 0.12);
  border-color: rgba(197, 155, 39, 0.35);
  font-weight: 700;
}

.dash-nav-item .badge-count {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}

.sidebar-footer {
  padding: 20px 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  background: #fbfbfd;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #c59b27;
}

.user-info-text {
  overflow: hidden;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0b0f19;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #c59b27;
}

/* Main Dashboard Content Area */
.dash-main {
  margin-left: 275px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dash-topbar {
  height: 84px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.topbar-left h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0b0f19;
}

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

.balance-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  background: rgba(197, 155, 39, 0.08);
  border: 1px solid rgba(197, 155, 39, 0.3);
  border-radius: 99px;
  font-size: 0.92rem;
}

.balance-amount {
  font-family: var(--font-mono);
  font-weight: 800;
  color: #9a7615;
}

.dash-body {
  padding: 36px;
  flex: 1;
}

/* Metrics Cards Row */
.metrics-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-bottom: 32px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 18px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(197, 155, 39, 0.12);
  border-color: rgba(197, 155, 39, 0.4);
}

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.metric-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.metric-icon-wrap.cyan {
  background: rgba(197, 155, 39, 0.12);
  color: #c59b27;
}

.metric-icon-wrap.purple {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.metric-icon-wrap.emerald {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

.metric-icon-wrap.amber {
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  color: #0b0f19;
  margin-bottom: 6px;
}

.metric-subtext {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trend-up {
  color: #059669;
  font-weight: 700;
}

/* Dashboard Sections & Panels */
.dash-panel {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.03);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.panel-title {
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #0b0f19;
}

/* Connected Ad Accounts Cards */
.ad-accounts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 20px;
}

.ad-acc-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 22px;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.ad-acc-card:hover {
  border-color: rgba(197, 155, 39, 0.5);
  box-shadow: 0 10px 30px rgba(197, 155, 39, 0.12);
}

.ad-acc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #0b0f19;
}

.network-meta { border-left: 3px solid #1877f2; }
.network-google { border-left: 3px solid #4285f4; }
.network-tiktok { border-left: 3px solid #fe2c55; }
.network-microsoft { border-left: 3px solid #00a4ef; }

.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
}

.status-active {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.status-paused {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.status-pending {
  background: rgba(197, 155, 39, 0.12);
  color: #9a7615;
  border: 1px solid rgba(197, 155, 39, 0.3);
}

.ad-acc-id {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 6px;
}

.ad-acc-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: #0b0f19;
}

.ad-acc-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  padding-top: 14px;
  font-size: 0.82rem;
}

.ad-acc-meta-item span {
  display: block;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
}

.ad-acc-meta-item strong {
  color: #0b0f19;
  font-family: var(--font-mono);
}

/* Toggle Switch for turning Ads ON/OFF */
.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: #cbd5e1;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: #059669;
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.4);
}

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

/* Data Tables */
.data-table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 14px 18px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 2px solid rgba(226, 232, 240, 0.9);
  letter-spacing: 0.06em;
  background: #f8fafc;
}

.data-table td {
  padding: 16px 18px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  color: #334155;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(197, 155, 39, 0.03);
}

/* Deposit QR Box */
.deposit-qr-wrap {
  text-align: center;
  padding: 24px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  margin-bottom: 20px;
}

.crypto-addr-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  padding: 12px 18px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #9a7615;
  border: 1px solid rgba(197, 155, 39, 0.3);
  margin-top: 12px;
  word-break: break-all;
}

/* Toast Notifications */
.toast-msg {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 14px 22px;
  border-radius: 10px;
  background: #ffffff;
  color: #0b0f19;
  border: 1px solid rgba(197, 155, 39, 0.4);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 600;
}

.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive */
@media (max-width: 1200px) {
  .metrics-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .ad-accounts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .dash-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .dash-sidebar.open {
    transform: translateX(0);
  }
  .dash-main {
    margin-left: 0;
  }
  .ad-accounts-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid-4 {
    grid-template-columns: 1fr;
  }
}
