/* ================================================
   TeleAds Dashboard Layout - Unified Client Zone
   Modern 2025 Design with Collapsible Sidebar
   ================================================ */

/* CSS Variables for Dashboard */
:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --sidebar-bg: rgba(255, 255, 255, 0.7);
  --sidebar-border: rgba(99, 102, 241, 0.08);
  --sidebar-text: #64748b;
  --sidebar-text-active: #4f46e5;
  --sidebar-hover-bg: rgba(99, 102, 241, 0.05);
  --sidebar-active-bg: rgba(99, 102, 241, 0.08);
  --sidebar-active-border: transparent;
  --topbar-height: 64px;
  --transition-speed: 300ms;
  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --bottom-tab-height: 64px;
}

/* Dashboard Layout Container */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: #f8fafc;
}

/* ================================================
   Sidebar Styles
   ================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-speed) var(--transition-ease), transform var(--transition-speed) var(--transition-ease);
  z-index: 1000;
  overflow: visible;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: 72px;
  position: relative;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 8px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  overflow: hidden;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.sidebar-logo-img {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.sidebar-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition-speed) var(--transition-ease);
}

.sidebar.collapsed .sidebar-logo-text {
  opacity: 0;
  width: 0;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: none;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) var(--transition-ease);
}

.sidebar-toggle:hover {
  background: rgba(99, 102, 241, 0.15);
}

.sidebar-toggle svg {
  width: 16px;
  height: 16px;
  color: #6366f1;
  transition: transform var(--transition-speed) var(--transition-ease);
}

/* Collapsed state: toggle button outside sidebar */
.sidebar.collapsed .sidebar-toggle {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  z-index: 10;
}

.sidebar.collapsed .sidebar-toggle:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  transform: translateY(-50%) scale(1.1);
}

.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
  color: white;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.15);
  border-radius: 2px;
}

/* Menu Section */
.menu-section {
  margin-bottom: 24px;
}

.menu-section-title {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #6366f1;
  padding: 0 20px;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0.7;
  transition: opacity var(--transition-speed) var(--transition-ease);
}

.sidebar.collapsed .menu-section-title {
  opacity: 0;
}

/* Menu Items */
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 2px 12px 2px 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  transition: all var(--transition-speed) var(--transition-ease);
  white-space: nowrap;
  position: relative;
}

.menu-item:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-active);
}

.menu-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.08));
  color: var(--sidebar-text-active);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.menu-item-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-item-icon svg {
  width: 20px;
  height: 20px;
}

.menu-item-text {
  opacity: 1;
  transition: opacity var(--transition-speed) var(--transition-ease);
}

.sidebar.collapsed .menu-item-text {
  opacity: 0;
  width: 0;
}

/* Tooltip for collapsed state */
.sidebar.collapsed .menu-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--sidebar-collapsed-width) + 8px);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: #1e293b;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-speed) var(--transition-ease);
  z-index: 1001;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(99, 102, 241, 0.08);
}

.sidebar.collapsed .menu-item:hover::after {
  opacity: 1;
}

/* Admin menu item styling */
.admin-menu-item .menu-item-icon {
  color: #f59e0b;
}

.admin-menu-item:hover .menu-item-icon,
.admin-menu-item.active .menu-item-icon {
  color: #fbbf24;
}

.admin-menu-item.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(234, 88, 12, 0.08));
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

/* Sidebar Footer / My Account */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
  position: relative;
}

.sidebar.collapsed .sidebar-footer {
  padding: 8px;
}

/* My Account Button */
.my-account-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-ease);
  color: #4f46e5;
  font-size: 13px;
  font-weight: 600;
}

.my-account-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.15);
}

.my-account-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.my-account-icon svg {
  width: 20px;
  height: 20px;
}

.my-account-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity var(--transition-speed) var(--transition-ease);
}

.sidebar.collapsed .my-account-btn {
  justify-content: center;
  padding: 8px;
}

.sidebar.collapsed .my-account-text {
  display: none;
}

/* Account Flyout */
.account-flyout {
  position: absolute;
  bottom: 8px;
  left: calc(100% + 8px);
  min-width: 220px;
  background: white;
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(99, 102, 241, 0.08);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  transition: all 0.2s ease;
  z-index: 2000;
}

.account-flyout.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Flyout Items */
.flyout-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.flyout-item:hover {
  background: rgba(99, 102, 241, 0.06);
  color: #4f46e5;
}

.flyout-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.flyout-icon svg {
  width: 18px;
  height: 18px;
}

/* Flyout Language Item */
.flyout-lang {
  justify-content: flex-start;
  cursor: default;
}

.flyout-lang-options {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.flyout-lang-btn {
  padding: 4px 10px;
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.flyout-lang-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
}

.flyout-lang-btn.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #4f46e5;
}

/* Flyout Plan Item */
.flyout-plan-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.flyout-plan-name {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
}

.flyout-plan.pro .flyout-plan-name {
  color: #059669;
}

.flyout-plan-expires {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

.flyout-plan-expires.expired {
  color: #ef4444;
  font-weight: 500;
}

.flyout-plan-expires.unlimited {
  font-size: 13px;
  font-weight: 600;
  color: #10b981;
}

.flyout-plan-expires.expiring-soon {
  color: #f59e0b;
  font-weight: 600;
  animation: pulse-warning 2s infinite;
}

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

/* Flyout Logout */
.flyout-logout:hover {
  background: rgba(239, 68, 68, 0.06);
  color: #ef4444;
}

.flyout-logout:hover .flyout-icon svg {
  color: #ef4444;
}

/* Renew button in flyout */
.plan-renew-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  margin-left: auto;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.plan-renew-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.3);
}

.plan-renew-btn svg {
  width: 12px;
  height: 12px;
}

/* Renewal Modal Overlay */
.renewal-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.renewal-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.renewal-modal {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.renewal-modal-overlay.active .renewal-modal {
  transform: translateY(0);
}

.renewal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.renewal-modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.renewal-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.renewal-modal-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.renewal-modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.renewal-loading {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}

.renewal-error {
  text-align: center;
  padding: 40px 20px;
  color: #ef4444;
}

.renewal-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.renewal-plan {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.renewal-plan-name {
  font-size: 20px;
  font-weight: 700;
  color: #8b5cf6;
  margin-bottom: 4px;
}

.renewal-plan-price {
  font-size: 14px;
  color: #64748b;
}

.renewal-addons {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
}

.renewal-addons h4 {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 12px 0;
}

.renewal-addons ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.renewal-addons li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #64748b;
}

.renewal-addons li span:last-child {
  font-weight: 600;
  color: #1e293b;
}

.renewal-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.renewal-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #64748b;
}

.renewal-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  margin-top: 8px;
}

.renewal-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 10px;
  font-size: 13px;
  color: #059669;
}

.renewal-note svg {
  flex-shrink: 0;
}

.renewal-modal-footer {
  padding: 16px 24px 24px;
}

.renewal-pay-btn {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.renewal-pay-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.renewal-pay-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ================================================
   Main Content Area
   ================================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-speed) var(--transition-ease);
  overflow-x: hidden;
  overflow-y: visible;
  max-width: calc(100vw - var(--sidebar-width));
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
  max-width: calc(100vw - var(--sidebar-collapsed-width));
}

/* Top Bar */
.top-bar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.02);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
}

.mobile-menu-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
  color: #1e293b;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Content Area - no inner scroll, use window scroll only */
.content-area {
  flex: 1;
  padding: 24px;
  overflow: visible;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

/* ================================================
   Mobile Overlay
   ================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition-speed) var(--transition-ease);
}

.sidebar-overlay.active {
  opacity: 1;
}

/* ================================================
   Responsive Styles
   ================================================ */
@media (max-width: 1024px) {
  .sidebar:not(.collapsed) {
    width: var(--sidebar-collapsed-width);
  }

  .sidebar:not(.collapsed) .sidebar-logo-text,
  .sidebar:not(.collapsed) .menu-section-title,
  .sidebar:not(.collapsed) .menu-item-text,
  .sidebar:not(.collapsed) .my-account-text {
    opacity: 0;
    width: 0;
  }

  .main-content {
    margin-left: var(--sidebar-collapsed-width);
  }
}

@media (max-width: 768px) {
  /* Sidebar hidden by default, slides in via hamburger */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    max-width: 280px;
    box-shadow: 4px 0 24px rgba(99, 102, 241, 0.1);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    width: var(--sidebar-width);
    max-width: 280px;
  }

  .sidebar.mobile-open .sidebar-logo-text,
  .sidebar.mobile-open .menu-section-title,
  .sidebar.mobile-open .menu-item-text,
  .sidebar.mobile-open .my-account-text {
    opacity: 1;
    width: auto;
  }

  /* Overlay visible when sidebar is open */
  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }

  .sidebar-overlay.active {
    pointer-events: auto;
  }

  /* Show bottom tab bar */
  .bottom-tab-bar {
    display: block;
  }

  /* Hide desktop toggle, show hamburger */
  .sidebar-toggle {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 1001;
  }

  /* Main content takes full width with bottom padding for tab bar */
  .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: calc(var(--bottom-tab-height) + env(safe-area-inset-bottom, 0px));
  }

  .content-area {
    padding: 12px;
  }

  .top-bar {
    padding: 0 16px;
    height: 56px;
  }

  .top-bar-left {
    flex: 1;
    min-width: 0;
    gap: 8px;
  }

  .page-title {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Quick actions on dashboard */
  .quick-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .quick-action-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 140px;
    padding: 12px;
    font-size: 12px;
  }

  .quick-action-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Stats grid mobile */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
  }

  .stat-icon svg {
    width: 18px;
    height: 18px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-label {
    font-size: 11px;
  }

  /* Accounts list mobile */
  .accounts-list {
    gap: 8px;
  }

  .account-card {
    padding: 12px;
    flex-direction: column;
    gap: 10px;
  }

  .account-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .account-stats {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .account-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
  }

  .account-actions .btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  /* Dashboard card header buttons */
  .dashboard-card-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .dashboard-card-header > div {
    gap: 6px !important;
  }

  /* Toggle accounts button - icon only on mobile */
  #toggleAccountsBtn {
    padding: 6px !important;
    gap: 0 !important;
  }

  #toggleAccountsBtn span {
    display: none;
  }

  #toggleAccountsBtn svg {
    margin: 0 !important;
  }

  /* Account card buttons - icon only on mobile */
  .account-btn-text {
    display: none;
  }

  .account-btn {
    padding: 8px !important;
  }

  .account-btn svg {
    width: 16px !important;
    height: 16px !important;
  }
}

/* ================================================
   Dashboard Specific Styles
   ================================================ */

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

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.primary {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.stat-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.stat-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.stat-icon.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

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

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.stat-change {
  font-size: 12px;
  margin-top: 4px;
}

.stat-change.positive {
  color: #10b981;
}

.stat-change.negative {
  color: #ef4444;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #1e293b;
}

.quick-action-btn:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.02);
}

.quick-action-btn svg {
  width: 24px;
  height: 24px;
  color: #6366f1;
}

.quick-action-btn span {
  font-size: 14px;
  font-weight: 500;
}

/* Account card action buttons */
.account-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  border: none;
}

.account-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.account-btn-topup {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.account-btn-history {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.account-btn-dashboard {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}

/* Dashboard Cards */
.dashboard-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.dashboard-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.dashboard-card-body {
  padding: 24px;
}

/* Activity List */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.activity-icon.primary {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.activity-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.activity-icon svg {
  width: 18px;
  height: 18px;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 2px;
}

.activity-time {
  font-size: 12px;
  color: #94a3b8;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: #cbd5e1;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: #94a3b8;
}

/* ================================================
   App Footer
   ================================================ */
.app-footer {
  margin-top: auto;
  padding: 24px 0 16px;
  text-align: center;
}

.app-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.app-footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.app-footer-links a:hover {
  color: #6366f1;
  text-decoration: underline;
}

.app-footer-links .footer-divider {
  color: #cbd5e1;
}

/* ================================================
   Bottom Tab Bar (Mobile)
   ================================================ */
.bottom-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-tab-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border-top: 1px solid rgba(99, 102, 241, 0.08);
  z-index: 1000;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-tab-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.bottom-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 12px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 12px;
  transition: all var(--transition-speed) var(--transition-ease);
  -webkit-tap-highlight-color: transparent;
  min-width: 56px;
}

.bottom-tab-item:active {
  transform: scale(0.9);
}

.bottom-tab-item.active {
  color: #6366f1;
}

.bottom-tab-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all var(--transition-speed) var(--transition-ease);
}

.bottom-tab-item.active .bottom-tab-icon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.bottom-tab-icon svg {
  width: 20px;
  height: 20px;
}

.bottom-tab-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
