:root {
  --ux-primary: #4f46e5;
  --ux-primary-strong: #4338ca;
  --ux-accent: #0ea5e9;
  --ux-success: #16a34a;
  --ux-warning: #d97706;
  --ux-danger: #dc2626;
  --ux-bg: #f3f6fb;
  --ux-surface: #ffffff;
  --ux-border: #dbe4f1;
  --ux-text: #0f172a;
  --ux-muted: #64748b;
  --ux-radius: 14px;
  --ux-font: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Shared typography foundation */
body {
  color: var(--ux-text);
  font-family: var(--ux-font);
  font-size: 13.5px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* Website shell */
.mkt-body {
  background: radial-gradient(circle at top right, #eef2ff, #f8fbff 50%, #f3f6fb);
  color: var(--ux-text);
  font-family: var(--ux-font);
}
.mkt-nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ux-border);
}
.mkt-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mkt-logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--ux-border);
  background: #ffffff;
  object-fit: contain;
  padding: 6px;
}
.mkt-logo-text {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.15;
  color: #101828;
}
.mkt-logo-text small {
  display: block;
  font-size: 0.68rem;
  color: var(--ux-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.mkt-pill {
  border: 1px solid #c7d2fe;
  color: #3730a3;
  background: #eef2ff;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}
.mkt-card {
  background: var(--ux-surface);
  border: 1px solid var(--ux-border);
  border-radius: var(--ux-radius);
}
.mkt-muted {
  color: var(--ux-muted);
}
.mkt-btn-primary {
  background: var(--ux-primary);
  color: #fff;
  border: 1px solid var(--ux-primary);
}
.mkt-btn-primary:hover {
  background: var(--ux-primary-strong);
}
.mkt-btn-outline {
  border: 1px solid #cbd5e1;
  color: #1e293b;
  background: #fff;
}
.mkt-tag {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

/* ===================================================================
   Admin shell — TailAdmin-style light theme
   White sidebar, readable slate text, soft indigo active states.
   =================================================================== */

:root {
  --adm-sidebar-bg: #ffffff;
  --adm-sidebar-border: #e4e7ec;
  --adm-nav-text: #344054;
  --adm-nav-icon: #667085;
  --adm-nav-hover-bg: #f4f6fb;
  --adm-active-bg: #eef2ff;
  --adm-active-text: var(--ux-primary);
  --adm-header-label: #98a2b3;
  --adm-content-bg: #f9fafb;
}

body.hold-transition.sidebar-mini.layout-fixed {
  background: var(--adm-content-bg);
  font-family: var(--ux-font);
  font-size: 13.5px;
}

/* ---- Top bar ---- */
.main-header.navbar {
  border-bottom: 1px solid var(--adm-sidebar-border);
  background: #ffffff;
  box-shadow: none;
}
.main-header .nav-link {
  color: var(--adm-nav-icon);
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 500;
}
.main-header .nav-link:hover {
  color: var(--ux-primary);
  background: var(--adm-nav-hover-bg);
}
.main-header .nav-link.btn.bg-gradient-primary {
  color: #fff;
  border-radius: 10px;
  padding: 0.45rem 1rem;
  font-weight: 600;
}

/* ---- Sidebar: light, readable ---- */
.main-sidebar,
.main-sidebar .sidebar {
  background: var(--adm-sidebar-bg) !important;
}
.main-sidebar.elevation-4 {
  box-shadow: none !important;
  border-right: 1px solid var(--adm-sidebar-border);
}
.main-sidebar .brand-link {
  border-bottom: 1px solid var(--adm-sidebar-border);
  padding: 0.7rem 0.8rem;
  min-height: 64px;
  display: flex;
  align-items: center;
}
.main-sidebar .brand-link .brand-text {
  color: var(--ux-text) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  font-size: 1rem;
  line-height: 1.1;
}
.main-sidebar .brand-link .brand-image {
  box-shadow: none !important;
  opacity: 1 !important;
  width: 38px;
  height: 38px;
  max-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--adm-sidebar-border);
  background: #fff;
  padding: 5px;
  margin-top: 0;
  object-fit: contain;
}

/* Section labels (MENU / SETTINGS / SUPER ADMIN) */
.main-sidebar .nav-header {
  color: var(--adm-header-label) !important;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1rem 1rem 0.4rem;
}

/* Base link state — dark readable text on white */
.main-sidebar .nav-sidebar .nav-link {
  color: var(--adm-nav-text) !important;
  border-radius: 10px;
  margin: 2px 8px;
  width: auto;
  font-weight: 500;
  font-size: 0.84rem;
  min-height: 36px;
  padding-top: 0.48rem;
  padding-bottom: 0.48rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.main-sidebar .nav-sidebar .nav-link p {
  color: inherit;
  font-size: 0.84rem;
  line-height: 1.2;
}
.main-sidebar .nav-sidebar .nav-icon {
  color: var(--adm-nav-icon);
  transition: color 0.15s ease;
  font-size: 0.82rem;
  width: 18px;
  text-align: center;
  margin-right: 0.5rem;
  opacity: 0.95;
}

/* Hover */
.main-sidebar .nav-sidebar .nav-link:hover {
  background: var(--adm-nav-hover-bg) !important;
  color: var(--ux-text) !important;
}
.main-sidebar .nav-sidebar .nav-link:hover .nav-icon {
  color: var(--ux-primary);
}

/* Active — soft indigo pill like TailAdmin */
.main-sidebar .nav-sidebar .nav-link.active,
.sidebar-light-lightblue .nav-sidebar > .nav-item > .nav-link.active {
  background: var(--adm-active-bg) !important;
  color: var(--adm-active-text) !important;
  box-shadow: none !important;
  font-weight: 600;
}
.main-sidebar .nav-sidebar .nav-link.active .nav-icon,
.main-sidebar .nav-sidebar .nav-link.active p {
  color: var(--adm-active-text) !important;
}

/* Open treeview parent */
.main-sidebar .nav-sidebar .menu-open > .nav-link {
  background: transparent !important;
  color: var(--ux-text) !important;
}
.main-sidebar .nav-sidebar .menu-open > .nav-link .nav-icon {
  color: var(--ux-primary);
}

/* Submenu items — indented, smaller */
.main-sidebar .nav-treeview {
  padding-left: 0.5rem;
}
.main-sidebar .nav-treeview .nav-link {
  font-size: 0.8rem;
  padding-top: 0.36rem;
  padding-bottom: 0.36rem;
}
.main-sidebar .nav-treeview .nav-icon.fa-circle {
  font-size: 0.4rem;
  vertical-align: middle;
}

/* Sidebar badges */
.main-sidebar .badge-warning {
  background: #fef0c7;
  color: #93370d;
  font-weight: 600;
}

/* ---- Content area ---- */
.content-wrapper {
  background: var(--adm-content-bg);
}
.content-header h1 {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.28rem;
}

/* ---- Cards ---- */
.card {
  border: 1px solid var(--adm-sidebar-border);
  border-radius: var(--ux-radius);
  box-shadow: none;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid #f0f2f5;
  font-size: 0.84rem;
  font-weight: 600;
}

/* ---- Buttons ---- */
.btn {
  border-radius: 10px;
}
.btn-primary,
.bg-gradient-primary {
  background: var(--ux-primary) !important;
  border-color: var(--ux-primary) !important;
}
.btn-primary:hover,
.bg-gradient-primary:hover {
  background: var(--ux-primary-strong) !important;
  border-color: var(--ux-primary-strong) !important;
}
.btn-success,
.bg-gradient-success {
  background: var(--ux-success) !important;
  border-color: var(--ux-success) !important;
}

/* ---- Tables ---- */
.table thead th {
  color: #475467;
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--adm-sidebar-border);
  border-top: 0;
  background: #f9fafb;
}
.table td {
  vertical-align: middle;
  color: var(--ux-text);
  font-size: 0.83rem;
}
.table-hover tbody tr:hover {
  background: #f8fafc;
}

/* ---- Badges ---- */
.badge {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.35em 0.75em;
}
.badge-success, .bg-primary.badge, .badge.bg-primary {
  background: #ecfdf3 !important;
  color: #027a48 !important;
}
.badge-warning {
  background: #fffaeb !important;
  color: #b54708 !important;
}
.badge-danger, .badge.bg-danger {
  background: #fef3f2 !important;
  color: #b42318 !important;
}

/* ---- Forms ---- */
.form-control {
  border-radius: 10px;
  border-color: #d0d5dd;
}
.form-control:focus {
  border-color: var(--ux-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* ---- Notification dropdown overflow fix ---- */
.adm-notify-menu.dropdown-menu {
  width: 360px;
  max-width: min(92vw, 360px);
  max-height: 420px;
  overflow-y: auto;
  padding-top: 0;
  padding-bottom: 0;
}
.adm-notify-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid var(--adm-sidebar-border);
  font-size: 0.76rem;
  color: #475467;
  font-weight: 600;
}
.adm-notify-item {
  white-space: normal !important;
  display: block;
  padding: 0.7rem 0.9rem;
}
.adm-notify-item .adm-notify-text {
  display: block;
  color: #111827;
  font-size: 0.8rem;
  line-height: 1.35;
  margin-bottom: 0.3rem;
  word-break: break-word;
}
.adm-notify-item .adm-notify-time {
  display: block;
  color: #6b7280;
  font-size: 0.72rem;
}

/* ---- Unified auth page ---- */
.auth-2026 {
  min-height: 100vh;
  background: radial-gradient(circle at top right, #eef2ff, #f8fbff 55%, #f3f6fb);
  font-family: var(--ux-font);
  color: var(--ux-text);
}
.auth-2026-header {
  background: #fff;
  border-bottom: 1px solid var(--ux-border);
}
.auth-2026-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.auth-2026-brand {
  text-decoration: none;
}
.auth-2026-back {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ux-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.auth-2026-back:hover {
  color: var(--ux-primary);
}
.auth-2026-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 20px 46px;
}
.auth-2026-main--centered {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 48px;
}
.auth-2026-panel {
  background: #fff;
  border: 1px solid var(--ux-border);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
}
.auth-2026-form {
  padding: 28px 26px 24px;
}
.auth-2026-form h1 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.auth-2026-sub {
  color: var(--ux-muted);
  font-size: 0.84rem;
  margin-bottom: 20px;
}
.auth-2026-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.auth-2026-input {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  height: 40px;
  padding: 0 12px;
  font-size: 0.84rem;
  background: #fff;
}
.auth-2026-input:focus {
  outline: none;
  border-color: var(--ux-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.auth-2026-field {
  margin-bottom: 14px;
}
.auth-2026-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}
.auth-2026-row label,
.auth-2026-row a {
  font-size: 0.78rem;
}
.auth-2026-row a {
  color: var(--ux-primary);
  text-decoration: none;
  font-weight: 600;
}
.auth-2026-submit {
  width: 100%;
  border: 0;
  border-radius: 10px;
  height: 40px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  background: var(--ux-primary);
}
.auth-2026-submit:hover {
  background: var(--ux-primary-strong);
}
.auth-2026-footer {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--ux-muted);
}
.auth-2026-footer a {
  color: var(--ux-primary);
  font-weight: 600;
  text-decoration: none;
}

/* ===================================================================
   DataTables — modern list style (Latest Transactions pattern)
   =================================================================== */

body.ux-has-datatable .content-header .row.mb-2 {
  display: none;
}

body.ux-has-datatable .content .card {
  border-radius: 16px;
  overflow: visible;
}

body.ux-has-datatable .content .card .card-body,
body.ux-has-datatable .content .card #table_data,
body.ux-has-datatable .dataTables_wrapper {
  overflow: visible !important;
}

/* Stable list-page action buttons (Add User, Add New, etc.) */
.card > .ux-list-actions,
.card > .mt-n5 {
  margin-top: 0 !important;
  padding: 12px 16px 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
}

.ux-dt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 16px 10px;
  border-bottom: 1px solid #f0f2f5;
}

.ux-dt-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.ux-dt-toolbar .dataTables_length {
  order: 2;
}

.ux-dt-toolbar .dataTables_filter {
  order: 3;
}

table.dataTable tbody td:last-child {
  position: relative;
  overflow: visible !important;
}

table.dataTable tbody td:last-child .dropdown-menu {
  right: 0;
  left: auto;
  z-index: 1060;
}

@media (max-width: 768px) {
  body.ux-has-datatable .content .card .table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
  }
}

.ux-dt-title {
  font-size: 1rem;
  font-weight: 700;
  color: #101828;
  letter-spacing: -0.01em;
}

.ux-dt-search {
  margin: 0 !important;
  float: none !important;
  text-align: right !important;
}

.ux-dt-search label {
  margin: 0;
  font-weight: 500;
  color: transparent;
  position: relative;
}

.ux-dt-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ux-dt-search-icon {
  position: absolute;
  left: 12px;
  color: #98a2b3;
  font-size: 0.78rem;
  pointer-events: none;
}

.ux-dt-search-input {
  border: 1px solid #e4e7ec !important;
  border-radius: 10px !important;
  height: 38px !important;
  padding: 0 12px 0 34px !important;
  min-width: 220px;
  font-size: 0.82rem !important;
  background: #fff !important;
  box-shadow: none !important;
}

.ux-dt-search-input:focus {
  border-color: var(--ux-primary) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

.dataTables_length {
  margin: 0 !important;
  float: none !important;
  font-size: 0.78rem;
  color: #667085;
}

.ux-dt-length-select {
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  height: 34px;
  margin: 0 6px;
  padding: 0 8px;
  font-size: 0.8rem;
}

table.dataTable {
  width: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0;
}

table.dataTable thead th {
  background: #fff !important;
  color: #667085 !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0;
  border-bottom: 1px solid #f0f2f5 !important;
  border-top: 0 !important;
  padding: 12px 16px !important;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}

table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
  padding-right: 28px !important;
}

table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.65rem;
  color: #98a2b3;
  opacity: 1;
}

table.dataTable thead th.sorting:after {
  content: "\f0dc";
  opacity: 0.45;
}

table.dataTable thead th.sorting_asc:after {
  content: "\f0de";
  color: var(--ux-primary);
}

table.dataTable thead th.sorting_desc:after {
  content: "\f0dd";
  color: var(--ux-primary);
}

table.dataTable thead th.sorting:before,
table.dataTable thead th.sorting_asc:before,
table.dataTable thead th.sorting_desc:before {
  display: none !important;
}

table.dataTable tbody td {
  padding: 14px 16px !important;
  border-top: 1px solid #f2f4f7 !important;
  border-bottom: 0 !important;
  color: #344054;
  font-size: 0.83rem;
  vertical-align: middle;
}

table.dataTable tbody tr:hover td {
  background: #f9fafb;
}

table.dataTable.no-footer {
  border-bottom: 0;
}

.ux-dt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px 16px;
  border-top: 1px solid #f0f2f5;
}

.dataTables_info {
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  font-size: 0.78rem;
  color: #667085;
}

.dataTables_paginate {
  margin: 0 !important;
  float: none !important;
}

.dataTables_paginate .pagination {
  margin: 0;
  gap: 4px;
}

.dataTables_paginate .paginate_button {
  border: 1px solid #e4e7ec !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #344054 !important;
  margin: 0 !important;
  padding: 6px 11px !important;
  font-size: 0.78rem !important;
  font-weight: 500;
  box-shadow: none !important;
}

.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover {
  background: #eef2ff !important;
  border-color: #c7d2fe !important;
  color: var(--ux-primary) !important;
}

.dataTables_paginate .paginate_button:hover {
  background: #f9fafb !important;
  border-color: #d0d5dd !important;
  color: #101828 !important;
}

.dataTables_paginate .paginate_button.disabled,
.dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.45;
  background: #fff !important;
}

/* Compact action menu (ellipsis) */
.ux-action-menu .dropdown-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #e4e7ec;
  background: #fff;
  color: #667085;
  box-shadow: none;
}

.ux-action-menu .dropdown-toggle:hover,
.ux-action-menu.show .dropdown-toggle {
  background: #f9fafb;
  color: #344054;
  border-color: #d0d5dd;
}

.ux-action-menu .dropdown-menu {
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
  padding: 6px;
  min-width: 190px;
}

.ux-action-menu .dropdown-item {
  border-radius: 8px;
  font-size: 0.82rem;
  padding: 0.45rem 0.65rem;
}

.ux-action-menu .dropdown-item:hover {
  background: #f4f6fb;
  color: #101828;
}

/* Legacy split action buttons → ellipsis style */
table.dataTable tbody td:last-child .btn-group:not(.ux-action-menu) > .btn:first-child {
  display: none;
}

table.dataTable tbody td:last-child .btn-group:not(.ux-action-menu) .dropdown-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
}

table.dataTable tbody td:last-child .btn-group:not(.ux-action-menu) .dropdown-toggle .sr-only {
  display: none;
}

table.dataTable tbody td:last-child .btn-group:not(.ux-action-menu) .dropdown-toggle:after {
  display: none;
}

table.dataTable tbody td:last-child .btn-group:not(.ux-action-menu) .dropdown-toggle:before {
  content: "\f141";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
}

@media (max-width: 768px) {
  .ux-dt-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ux-dt-search {
    text-align: left !important;
  }

  .ux-dt-search-input {
    width: 100%;
    min-width: 0;
  }

  .ux-dt-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .dataTables_paginate {
    text-align: center;
  }
}
