/*
  New UI foundation for member/admin panel pages.
  This file is intentionally global so all pages in `panel` are migrated.
*/

:root {
  --ui-bg: #f8fafc;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f1f5f9;
  --ui-border: #e2e8f0;
  --ui-text: #0f172a;
  --ui-text-soft: #64748b;
  --ui-primary: #6366f1;
  --ui-primary-2: #8b5cf6;
  --ui-success: #10b981;
  --ui-danger: #ef4444;
  --ui-warning: #f59e0b;
  --ui-info: #06b6d4;
  --ui-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --ui-gradient-soft: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  --ui-radius-sm: 10px;
  --ui-radius-md: 14px;
  --ui-radius-lg: 18px;
  --ui-shadow-sm: 0 4px 18px rgba(15, 23, 42, 0.06);
  --ui-shadow-md: 0 12px 32px rgba(15, 23, 42, 0.1);
}

html,
body {
  background: var(--ui-bg) !important;
  color: var(--ui-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
}

.main-content,
.page-content {
  background: var(--ui-bg) !important;
}

.page-content {
  min-height: 100vh;
}

.page-content > .container-fluid {
  padding: 1rem 1.25rem !important;
}

@media (max-width: 768px) {
  .page-content > .container-fluid {
    padding: 0.75rem 0.75rem 5.25rem !important;
  }
}

/* Top header */
#page-topbar {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow-sm);
}

#page-topbar .header-item {
  color: var(--ui-text-soft);
}

#page-topbar .header-item:hover {
  color: var(--ui-text);
}

/* Sidebar */
.vertical-menu {
  background: var(--ui-surface) !important;
  border-right: 1px solid var(--ui-border);
  box-shadow: none;
}

#sidebar-menu .menu-title {
  color: var(--ui-text-soft) !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

#sidebar-menu ul li a {
  color: #334155 !important;
  border-radius: var(--ui-radius-sm);
  margin: 2px 8px;
}

#sidebar-menu ul li a:hover {
  background: #eef2ff !important;
  color: var(--ui-primary) !important;
}

#sidebar-menu ul li.mm-active > a {
  background-image: var(--ui-gradient) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* Page title and breadcrumb shell */
.page-title-box {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  box-shadow: var(--ui-shadow-sm);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

.page-title-box h4 {
  color: var(--ui-text);
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.breadcrumb-item,
.breadcrumb-item a {
  color: var(--ui-text-soft) !important;
}

.breadcrumb-item.active {
  color: var(--ui-primary) !important;
}

/* Core cards */
.card,
.web-card {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: var(--ui-radius-md) !important;
  box-shadow: var(--ui-shadow-sm);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover,
.web-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ui-shadow-md);
}

.card .card-header {
  background: var(--ui-gradient-soft) !important;
  border-bottom: 1px solid var(--ui-border) !important;
  padding: 0.85rem 1rem !important;
}

.card .card-header.bg-transparent {
  background: var(--ui-gradient-soft) !important;
}

.card .card-body {
  padding: 1rem !important;
}

.card .card-title,
.card h4,
.card h5 {
  color: var(--ui-text);
}

.bg_prime {
  background: var(--ui-gradient) !important;
  color: #fff !important;
}

.bg_gradient_blue {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  color: #fff !important;
}

.bg_gradient_cream {
  background: linear-gradient(135deg, #fffdf3 0%, #f1f5f9 100%) !important;
}

.bg_sec {
  background: var(--ui-surface-soft) !important;
}

/* Buttons */
.btn {
  border-radius: 10px;
  font-weight: 600;
  box-shadow: none !important;
}

.btn-primary,
.bg-primary,
.badge.bg-primary {
  background-color: var(--ui-primary) !important;
  border-color: var(--ui-primary) !important;
}

.btn-primary:hover {
  background-color: #4f46e5 !important;
  border-color: #4f46e5 !important;
}

.btn-light {
  background: #eef2ff !important;
  color: #4338ca !important;
  border: 1px solid #c7d2fe !important;
}

.btn-secondary {
  background: #e2e8f0 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

.badge {
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.bg-success-subtle {
  background: #dcfce7 !important;
}

.text-success {
  color: #15803d !important;
}

.bg-danger-subtle {
  background: #fee2e2 !important;
}

.text-danger {
  color: #b91c1c !important;
}

.bg-warning-subtle {
  background: #fef3c7 !important;
}

.text-warning {
  color: #b45309 !important;
}

.bg-primary-subtle {
  background: #e0e7ff !important;
}

.text-primary {
  color: #4338ca !important;
}

/* Tables and datatable controls */
.table-responsive {
  padding: 0 !important;
}

.table {
  margin-bottom: 0;
  color: var(--ui-text);
}

.table > :not(caption) > * > * {
  border-color: var(--ui-border);
}

.table thead th,
.thead-light th {
  background: #eef2ff !important;
  color: #4338ca !important;
  font-weight: 700;
  border-bottom: 1px solid #c7d2fe !important;
}

.table tbody tr:hover {
  background: #f8faff;
}

.table-bordered th,
.table-bordered td {
  border-color: var(--ui-border) !important;
}

#dtBtnCon {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.65rem;
}

.dt-button {
  background: var(--ui-gradient) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 10px !important;
  padding: 0.45rem 0.85rem !important;
}

.dataTables_wrapper .dataTables_filter input,
div.dataTables_wrapper div.dataTables_filter input[type="search"] {
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important;
}

/* Forms */
.form-label,
label.form-label {
  color: #475569;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-control,
.form-select,
select.form-control,
textarea.form-control {
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  color: var(--ui-text);
  background: #fff;
}

.form-control:focus,
.form-select:focus,
select.form-control:focus,
textarea.form-control:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.select2-container--default .select2-selection--single {
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  height: 38px;
  padding-top: 4px;
}

.dropzone {
  border: 1px dashed #a5b4fc !important;
  border-radius: 12px !important;
  background: #f8faff;
}

/* Modals */
.modal-content {
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  box-shadow: var(--ui-shadow-md);
}

.modal-header {
  border-bottom: 1px solid var(--ui-border);
  background: var(--ui-gradient-soft);
}

/* Settings menu page */
.menu-list {
  max-width: 460px;
  margin: 0 auto;
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  box-shadow: var(--ui-shadow-sm);
  overflow: hidden;
  background: var(--ui-surface);
}

.menu-item a {
  color: var(--ui-text);
  border-bottom: 1px solid var(--ui-border) !important;
}

.menu-item a:hover {
  background: #eef2ff !important;
}

.menu-item:last-child a {
  border-bottom: 0 !important;
}

/* Dashboard aliases used on older pages */
.separator {
  width: 2px;
  height: 22px;
  background: #cbd5e1;
  display: inline-block;
}

.green {
  color: var(--ui-success) !important;
}

.red {
  color: var(--ui-danger) !important;
}

.package {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  box-shadow: var(--ui-shadow-sm);
}

.progress-bar {
  background: #e2e8f0;
  border-radius: 999px;
}

.progress {
  background: var(--ui-gradient);
}

.actions button span {
  border: 1px solid #c7d2fe !important;
  border-radius: 12px !important;
  background: var(--ui-gradient) !important;
}

.wallet,
.portfolio,
.income {
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow-sm);
}

.wallet-box p,
.income-box p {
  border: 1px solid var(--ui-border);
}

/* Mobile header and bottom nav */
.mob_header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid var(--ui-border) !important;
  backdrop-filter: blur(10px);
}

.mob_header .profile-pic {
  border: 1px solid #c7d2fe !important;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.22) !important;
}

footer {
  background: rgba(255, 255, 255, 0.96) !important;
  border-top: 1px solid var(--ui-border);
  backdrop-filter: blur(10px);
}

footer button,
footer button i {
  color: #475569 !important;
}

footer .footer_center {
  background: var(--ui-gradient) !important;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

footer .notification span {
  background: var(--ui-danger) !important;
}

/* Special pages */
.plan-features li {
  border-radius: 10px;
  border: 1px solid var(--ui-border) !important;
  padding: 6px 4px;
  font-weight: 600;
}

.plan-features li.active {
  border-color: #818cf8 !important;
  background: #eef2ff;
  color: #4338ca;
}

.calendar-container {
  border-radius: 14px;
  border: 1px solid var(--ui-border);
  padding: 0.85rem;
}

#zoom-container {
  border-radius: 12px;
  border: 1px solid var(--ui-border);
  background: #fff;
}

.wrapper {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow-md);
}

.spin-btn {
  background: var(--ui-gradient) !important;
  color: #fff !important;
}

#final-value {
  color: var(--ui-text) !important;
}

/* Minor quality utilities */
.no-shadow {
  box-shadow: none !important;
}

.text-basic {
  color: var(--ui-text) !important;
}

.data_loading {
  width: 30px;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
