﻿:root {
  --bb-header-color: #e0e0e0;
  --bb-header-bg: #702cf8;
}

.layout {
  --bb-layout-header-background: var(--bb-header-bg);
  --bb-layout-sidebar-banner-background: var(--bb-header-bg);
  --bb-layout-header-color: var(--bb-header-color);
  --bb-layout-title-color: var(--bb-header-color);
  --bb-layout-sidebar-width: 180px;
}

.layout-header {
  border-bottom: 1px solid var(--bs-border-color);
}

.layout-header .widget {
  margin-right: 2rem;
}

.layout-banner {
  border-bottom: 1px solid var(--bs-border-color);
}

.layout-banner .layout-logo {
  border: 0px solid var(--bb-header-color);
}

.layout-side {
  border-right: 1px solid var(--bs-border-color);
}

.layout-footer {
  border-top: 1px solid var(--bs-border-color);
}

.dropdown-logout {
  --bb-logout-text-color: var(--bb-header-color);
}

.logout-avatar {
  border-radius: 50%;
}

.dropdown-user img {
  border-radius: 50%;
}

.layout-drawer {
  padding: 6px;
  cursor: pointer;
}

.widget {
  --bb-widget-toggle-color: var(--bb-header-color);
}

.widget .dropdown-menu {
  --bs-dropdown-min-width: 16rem;
}

.widget .dropdown-body h3 {
  color: #666666;
  font-size: 14px;
  margin-bottom: 10px;
}

.widget .dropdown-body h4 {
  color: #444444;
  font-size: 15px;
  margin: 0;
}

.widget .dropdown-body small {
  color: #999999;
  font-size: 10px;
  position: absolute;
  top: 0;
  right: 0;
}

.widget .dropdown-item {
  padding: 0.5rem 1rem;
  min-width: 100px;
}

.widget .dropdown-item > div:not(.progress):last-child {
  width: calc(100% - 40px);
}

.widget .dropdown-item.active,
.widget .dropdown-item:active {
  color: inherit;
}

.widget .dropdown-item:not(:nth-of-type(odd)):active {
  background-color: inherit;
}

.widget .progress {
  height: 7px;
}

.table-cell {
  height: 100%;
  width: 100%;
}

.table-cell img {
  width: 46px;
  border-radius: var(--bs-border-radius);
}

.table-cell .progress {
  height: 6px;
  margin-top: .5rem;
}

.user-demo-address {
  margin-top: .25rem;
  font-size: 86%;
  color: #c0c4cc;
}

.table-demo {
  height: calc(100% - 56px);
}

.table-users-demo {
  height: calc(100vh - 162px);
}

.table-users {
  height: calc(100% - 93px);
}

.cell-label {
  line-height: 35px;
}

.menu {
  --bb-menu-active-color: #702cf8;
  --bb-menu-bar-bg: #702cf8;
  --bb-menu-item-hover-bg: #702cf8;
  --bb-menu-item-hover-color: #fff;
}

.btn-card {
  padding: 0.4rem 0.2rem !important;
}

.grid-table .table > tbody {
  vertical-align: middle !important;
}

.grid-table .table thead th  {
  text-align: center !important;
  vertical-align: middle !important;
}

.modal-header, .card-header {
  background-color: #702cf8;
}

.dropdown-menu {
  overflow: visible !important;
}

.container {
  --bs-gutter-x: 0rem !important;
}

.blockquote-footer, .quote-normal {
  color: #c0c4cc !important;
}

.quote-success::before, .quote-warning::before {
  content: "— "
}

.quote-warning, .quote-success, .quote-normal {
  --bs-text-opacity: 1;
  margin-top: -1rem;
  margin-bottom: 1rem;
  font-size: .875em;
}

.quote-warning {
  color: rgba(var(--bs-warning-rgb), var(--bs-text-opacity)) !important;
}

.quote-success {
  color: rgba(var(--bs-success-rgb), var(--bs-text-opacity)) !important;
}

.ts-control, .ts-control input, .ts-dropdown {
  color: var(--bs-body-color) !important;
}

.ts-wrapper.multi .ts-control > div {
  background: #495057 !important;
  color: var(--bs-body-color) !important;
}

.modal-footer {
  justify-content: flex-start !important;
}

.payinfo-dlg .modal-footer {
  justify-content: space-around !important;
}

.mask-asdp {
  background-image: url(./images/bg-asdp.svg);
  background-repeat: no-repeat;
  position: absolute;
  /* background-size: cover; */
  background-position: center center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.opacity-9 {
  opacity: 0.9 !important;
}

.p-4 {
  padding: 1.5rem !important;
}

.card-asdp {
  --bs-card-spacer-y: 1rem;
  --bs-card-spacer-x: 1rem;
  --bs-card-title-spacer-y: 0.5rem;
  --bs-card-border-width: 0;
  --bs-card-border-color: rgba(0, 0, 0, 0.125);
  --bs-card-border-radius: 0.75rem;
  --bs-card-box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --bs-card-inner-border-radius: 0.75rem;
  --bs-card-cap-padding-y: 0.5rem;
  --bs-card-cap-padding-x: 1rem;
  --bs-card-cap-bg: #fbfcfe;
  --bs-card-cap-color:;
  --bs-card-height:;
  --bs-card-color:;
  --bs-card-bg: #fbfcfe;
  --bs-card-img-overlay-padding: 1rem;
  --bs-card-group-margin: 0.75rem;
  position: relative;
  display: flex;
  flex-direction: column;
  /* min-width: 0; */
  width: var(--max-width-6, 552px);
  /* min-width: var(--max-width-6, 552px); */
  /* max-width: var(--max-width-7, 648px); */
  height: var(--bs-card-height);
  word-wrap: break-word;
  background-color: var(--bs-card-bg);
  background-clip: border-box;
  border: var(--bs-card-border-width) solid var(--bs-card-border-color);
  border-radius: var(--bs-card-border-radius);
}

/* Resizable table columns (wwwroot/js/resizable-table.js) */
table[data-resizable="1"] thead th {
  position: relative;
  overflow: visible;
  overflow-wrap: anywhere;
}

table[data-resizable="1"] td {
  overflow-wrap: anywhere;
}

/* Applied for a moment while the script measures each column's single-line content width. */
table.col-measuring th,
table.col-measuring td {
  white-space: nowrap !important;
  overflow-wrap: normal !important;
}

table.col-measuring td[colspan] {
  white-space: normal !important;
}

table.col-measuring .col-resizer {
  display: none;
}

/* The handle starts in the header cell and is stretched (by JS) down the whole table. */
.col-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 3;
}

.col-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 3px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.15s;
}

.col-resizer:hover::after,
.col-resizer.active::after {
  background: linear-gradient(180deg, #8b5cf6, #06b6d4);
}

body.col-resizing,
body.col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}


/* ---------------------------------------------------------------------------
   Modern accents (dark theme). Gradients built on the existing brand purple.
   --------------------------------------------------------------------------- */
:root {
  --stm-grad-brand: linear-gradient(135deg, #7c3aed 0%, #5b21b6 55%, #4338ca 100%);
  --stm-grad-primary: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --stm-grad-success: linear-gradient(135deg, #10b981 0%, #0d9488 100%);
  --stm-grad-title: linear-gradient(90deg, #c4b5fd 0%, #93c5fd 100%);
  --stm-surface: rgba(255, 255, 255, 0.03);
  --stm-radius: 12px;
  --stm-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Header, sidebar banner, card and modal headers */
.layout-header,
.layout-banner {
  background-image: var(--stm-grad-brand);
}

.modal-header,
.card-header {
  background-color: #702cf8;
  background-image: var(--stm-grad-brand);
  border-bottom: 0;
}

.card {
  --bs-card-border-radius: var(--stm-radius);
  box-shadow: var(--stm-shadow);
}

.card.border-primary {
  border-color: rgba(139, 92, 246, 0.6) !important;
}

.modal {
  --bs-modal-border-radius: var(--stm-radius);
}

.modal-content {
  box-shadow: var(--stm-shadow);
}

/* Page titles */
h4.fw-bold {
  background: var(--stm-grad-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.2px;
}

/* Buttons */
.btn {
  border-radius: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-primary {
  background-image: var(--stm-grad-primary);
  border-color: transparent;
}

.btn-success {
  background-image: var(--stm-grad-success);
  border-color: transparent;
}

.btn-primary:not(:disabled):hover,
.btn-success:not(:disabled):hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}

.btn:disabled,
.btn.disabled {
  filter: saturate(0.6);
}

/* Toolbar buttons stacked on the payment grids */
.grid-actions {
  min-width: 220px;
}

.grid-actions .btn {
  width: 100%;
  text-align: left;
}

/* Tables */
.table-responsive,
.grid-table .table-wrapper {
  border-radius: var(--stm-radius);
}

.table > thead th,
.grid-table .table thead th {
  background-image: linear-gradient(180deg, rgba(124, 58, 237, 0.22) 0%, rgba(79, 70, 229, 0.12) 100%);
}

.table > tbody > tr {
  transition: background-color 0.12s ease;
}

.table-hover > tbody > tr:hover > *,
.grid-table .table > tbody > tr:hover > * {
  --bs-table-bg-state: rgba(139, 92, 246, 0.08);
}

.table > tfoot td {
  background-color: var(--stm-surface);
}

/* Inputs */
.form-control:focus,
.form-select:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25);
}

/* Pagination */
.pagination .page-item.active .page-link {
  background-image: var(--stm-grad-primary);
  border-color: transparent;
}

/* Alerts inside panels */
.alert-info {
  border: 0;
  background-image: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(124, 58, 237, 0.14));
}

/* Page background: lighter gray across the upper half, easing into a slightly darker bottom */
html,
body {
  min-height: 100%;
}

body {
  background-color: #23252a;
  background-image: linear-gradient(180deg,
    #383b42 0%,
    #33363c 22%,
    #2d3035 45%,
    #272a2e 68%,
    #222428 85%,
    #1c1e21 100%);
  background-attachment: fixed;
}

.layout.is-page .layout-side {
  --bb-layout-sidebar-background: rgba(20, 22, 26, 0.35);
}

.layout {
  --bb-layout-footer-background: transparent;
}

/* Payout panel summary tiles */
.payout-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.modal-dialog.modal-xl.payout-modal-wide {
  --bs-modal-width: min(96vw, 1600px);
}

.payout-modal-wide .modal-content {
  position: relative;
}

.payout-processing-overlay,
.payout-result-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bs-body-bg, #fff);
}

.payout-processing-overlay {
  background: rgba(255, 255, 255, 0.92);
}

.payout-result-overlay > div {
  width: min(100%, 560px);
}

.payout-tile {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background-image: linear-gradient(135deg, rgba(124, 58, 237, 0.16) 0%, rgba(79, 70, 229, 0.06) 100%);
}

.payout-tile.is-ok {
  border-color: rgba(16, 185, 129, 0.45);
  background-image: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(13, 148, 136, 0.06) 100%);
}

.payout-tile.is-danger {
  border-color: rgba(239, 68, 68, 0.6);
  background-image: linear-gradient(135deg, rgba(239, 68, 68, 0.22) 0%, rgba(220, 38, 38, 0.08) 100%);
}

.payout-tile-label {
  font-size: 0.8rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.payout-tile-value {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2px;
}

.payout-tile-note {
  font-size: 0.8rem;
  opacity: 0.8;
}

.payout-confirmation-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
}

.payout-confirmation-dialog {
  width: min(100%, 520px);
  padding: 1.5rem;
  border-radius: 0.5rem;
  background: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #212529);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.25);
}

.payout-confirmation-total {
  margin: 1rem 0;
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 992px) {
  .payout-summary {
    grid-template-columns: 1fr;
  }
}

/* Whole info/attachment box next to a row is clickable, not just the small purple square */
.card-click {
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.card-click:hover {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
}

/* Breathing room around the grid filter inputs so they don't touch the header or the first row */
.grid-table .filter-header th {
  --bb-table-td-padding-x: 0.5rem;
  --bb-table-td-padding-y: 0.45rem;
  padding: 0.45rem 0.5rem !important;
}

/* Light / dark switch in the header (wwwroot/js/theme-toggle.js) */
.theme-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  margin-right: 0.75rem;
  border-radius: 50%;
  color: var(--bb-header-color);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Light mode: same gradient idea, light grays, and readable versions of the dark-only accents */
[data-bs-theme="light"] body {
  background-color: #eceef2;
  background-image: linear-gradient(180deg,
    #fbfbfd 0%,
    #f5f6f9 25%,
    #eff1f4 50%,
    #e8eaef 75%,
    #e1e4ea 100%);
}

[data-bs-theme="light"] .layout.is-page .layout-side {
  --bb-layout-sidebar-background: rgba(255, 255, 255, 0.6);
}

[data-bs-theme="light"] h4.fw-bold {
  background: linear-gradient(90deg, #6d28d9 0%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-bs-theme="light"] .card,
[data-bs-theme="light"] .modal-content {
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

[data-bs-theme="light"] .blockquote-footer,
[data-bs-theme="light"] .quote-normal {
  color: #6b7280 !important;
}

[data-bs-theme="light"] .ts-wrapper.multi .ts-control > div {
  background: #e9ecef !important;
}

[data-bs-theme="light"] .table > tfoot td {
  background-color: rgba(15, 23, 42, 0.03);
}

/* Payout status badge in the Proceed to Payment panel */
.payout-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  min-width: 96px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}

.payout-status.is-completed {
  color: #34d399;
  background-color: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
}

.payout-status.is-pending {
  color: #fbbf24;
  background-color: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
}

.payout-status.is-rejected {
  color: #f87171;
  background-color: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
  cursor: help;
}

.payout-status.is-not-sent {
  color: #94a3b8;
  background-color: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.3);
}

[data-bs-theme="light"] .payout-status.is-completed { color: #047857; }
[data-bs-theme="light"] .payout-status.is-pending { color: #b45309; }
[data-bs-theme="light"] .payout-status.is-rejected { color: #b91c1c; }
[data-bs-theme="light"] .payout-status.is-not-sent { color: #64748b; }
