/*
 * mobile-theme.css (ui-stage2) - stage 2: colour themes, dark mode, live counters, dashboard quick actions,
 * status colours, call / WhatsApp / copy buttons and the "Requests" inbox.
 * Load AFTER mobile-app.css. The admin screens are phone-only (max-width 767.98px) like stage 1;
 * only the Requests page also looks right on a big screen.
 */

/* ---------------------------------------------------------------- colour themes (variables only) */
:root {
  --ui2-rgb: 13, 110, 253;
  --ui2-grad: linear-gradient(135deg, #0d6efd 0%, #2563eb 55%, #6366f1 100%);
  --app-blue: #0d6efd; --app-blue-dark: #0a58ca;
  --app-ink: #14263f; --app-muted: #6b7a90; --app-line: #e6ebf3; --app-bg: #f1f4f9;
  --app-card: #fff; --app-field: #fff; --app-tint: #f3f6fb; --app-shadow: rgba(20, 38, 63, .09);
}
html[data-theme="ocean"]   { --ui2-rgb: 13, 110, 253;  --app-blue: #0d6efd; --app-blue-dark: #0a58ca; --ui2-grad: linear-gradient(135deg, #0d6efd 0%, #2563eb 55%, #6366f1 100%); }
html[data-theme="violet"]  { --ui2-rgb: 124, 58, 237;  --app-blue: #7c3aed; --app-blue-dark: #5b21b6; --ui2-grad: linear-gradient(135deg, #7c3aed 0%, #a21caf 60%, #db2777 100%); }
html[data-theme="emerald"] { --ui2-rgb: 5, 150, 105;   --app-blue: #047857; --app-blue-dark: #065f46; --ui2-grad: linear-gradient(135deg, #047857 0%, #059669 50%, #0891b2 100%); }
html[data-theme="sunset"]  { --ui2-rgb: 234, 88, 12;   --app-blue: #c2410c; --app-blue-dark: #9a3412; --ui2-grad: linear-gradient(135deg, #f97316 0%, #ea580c 45%, #e11d48 100%); }
html[data-theme="rose"]    { --ui2-rgb: 225, 29, 72;   --app-blue: #e11d48; --app-blue-dark: #be123c; --ui2-grad: linear-gradient(135deg, #e11d48 0%, #db2777 55%, #9333ea 100%); }
html[data-theme="gold"]    { --ui2-rgb: 217, 119, 6;   --app-blue: #b45309; --app-blue-dark: #92400e; --ui2-grad: linear-gradient(135deg, #b45309 0%, #d97706 50%, #f59e0b 100%); }

html[data-mode="dark"] {
  color-scheme: dark;
  --app-bg: #0e1522; --app-card: #172033; --app-field: #101a2c; --app-tint: #1d2940;
  --app-ink: #e8eefb; --app-muted: #92a3bf; --app-line: #27344d; --app-shadow: rgba(0, 0, 0, .35);
}
html[data-mode="dark"][data-theme="ocean"]   { --app-blue: #5b9dff; }
html[data-mode="dark"][data-theme="violet"]  { --app-blue: #a78bfa; }
html[data-mode="dark"][data-theme="emerald"] { --app-blue: #34d399; }
html[data-mode="dark"][data-theme="sunset"]  { --app-blue: #fb923c; }
html[data-mode="dark"][data-theme="rose"]    { --app-blue: #fb7185; }
html[data-mode="dark"][data-theme="gold"]    { --app-blue: #fbbf24; }

/* ---------------------------------------------------------------- phone alerts (push) */
.ui2-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 12px; font-size: 14px; font-weight: 900; color: var(--app-blue); background: rgba(var(--ui2-rgb), .12); cursor: pointer; }
.ui2-btn:disabled { opacity: .55; }
.ui2-btn.solid { color: #fff; background: var(--ui2-grad); box-shadow: 0 6px 14px rgba(var(--ui2-rgb), .3); }
.rq-push { position: relative; display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 12px 40px 12px 14px; border-radius: 18px; background: var(--app-card); border: 1px solid rgba(var(--ui2-rgb), .28); box-shadow: 0 6px 18px var(--app-shadow); }
.rq-push > i.fa-bell { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; background: var(--ui2-grad); }
.rq-push div { flex: 1 1 auto; min-width: 0; }
.rq-push b { display: block; font-size: 15px; font-weight: 900; color: var(--app-ink); }
.rq-push span { display: block; margin-top: 1px; font-size: 12.5px; font-weight: 700; line-height: 1.35; color: var(--app-muted); }
.rq-push .ui2-btn { flex: 0 0 auto; }
.rq-push-x { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--app-muted); font-size: 14px; }
.ui2-pushnote { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 2px; padding: 11px 12px; border-radius: 14px; background: var(--app-tint); color: var(--app-muted); font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.ui2-pushnote i { flex: 0 0 auto; margin-top: 2px; color: var(--app-blue); }
.ui2-pushnote.warn { background: rgba(245, 158, 11, .14); color: #92400e; }
.ui2-pushnote.warn i { color: #d97706; }
html[data-mode="dark"] .ui2-pushnote.warn { color: #fcd34d; }
.ui2-pushrow { display: flex; align-items: center; gap: 12px; margin: 8px 0 2px; }
.ui2-pushres { flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 800; color: var(--app-muted); }

/* ---------------------------------------------------------------- shared small parts (all sizes) */
.ui2-badge {
  position: absolute; top: 4px; left: calc(50% + 6px); z-index: 2;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 900; line-height: 19px; text-align: center;
  box-shadow: 0 0 0 2px var(--app-card); animation: ui2Pop .3s ease;
}
.ui2-badge-inline { left: auto; right: 16px; top: 50%; margin-top: -10px; box-shadow: none; }
#accordionSidebar .nav-link { position: relative; }
@keyframes ui2Pop { from { transform: scale(.4); } to { transform: scale(1); } }
@keyframes ui2Ping { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }

.ui2-net { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 3000; padding: 12px 16px; border-radius: 14px; font-size: 14px; font-weight: 800; text-align: center; color: #fff; background: #1f2937; box-shadow: 0 10px 28px rgba(0, 0, 0, .3); }
.ui2-net.bad { background: #dc2626; }
.ui2-net a { color: #fff; text-decoration: underline; }

/* ---------------------------------------------------------------- Requests inbox (all sizes) */
.rq { max-width: 1100px; margin: 0 auto; }
.rq-seg { display: flex; gap: 6px; margin-bottom: 10px; padding: 5px; background: var(--app-card); border-radius: 18px; box-shadow: 0 6px 18px var(--app-shadow); }
.rq-tab { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 8px; border: 0; border-radius: 14px; background: transparent; color: var(--app-muted); font-size: 15px; font-weight: 900; }
.rq-tab.active { background: var(--ui2-grad); color: #fff; box-shadow: 0 6px 14px rgba(var(--ui2-rgb), .35); }
.rq-tab i { font-size: 18px; }
.rq-n { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: rgba(127, 127, 127, .18); font-size: 13px; font-weight: 900; line-height: 26px; text-align: center; }
.rq-tab.active .rq-n { background: rgba(255, 255, 255, .3); }
.rq-n.has { background: #ef4444 !important; color: #fff; }
.rq-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.rq-search { position: relative; flex: 1 1 auto; }
.rq-search i { position: absolute; left: 16px; top: 50%; margin-top: -8px; color: var(--app-muted); }
.rq-search input { width: 100%; height: 50px; padding: 0 14px 0 44px; border: 2px solid var(--app-line); border-radius: 16px; background: var(--app-field); color: var(--app-ink); font-size: 16px; -webkit-appearance: none; }
.rq-search input:focus { outline: 0; border-color: var(--app-blue); box-shadow: 0 0 0 4px rgba(var(--ui2-rgb), .15); }
.rq-refresh { flex: 0 0 50px; height: 50px; border: 0; border-radius: 16px; background: var(--app-card); color: var(--app-blue); font-size: 17px; box-shadow: 0 6px 18px var(--app-shadow); }
.rq-refresh.spin i { animation: ui2Spin .8s linear infinite; }
@keyframes ui2Spin { to { transform: rotate(360deg); } }
.rq-sum { margin-bottom: 10px; padding: 0 4px; font-size: 13px; font-weight: 800; color: var(--app-muted); }
.rq-sum:empty { display: none; }
.rq-sum.is-clear { color: #16a34a; }

.rq-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.rq-card { position: relative; overflow: hidden; padding: 14px 16px 14px 20px; border-radius: 22px; background: var(--app-card); color: var(--app-ink); box-shadow: 0 8px 22px var(--app-shadow); transition: opacity .2s; max-height: 900px; }
.rq-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--rq-c, #22c55e); }
.rq-card.age-ok { --rq-c: #22c55e; --rq-t: #15803d; } .rq-card.age-warn { --rq-c: #f59e0b; --rq-t: #b45309; } .rq-card.age-late { --rq-c: #ef4444; --rq-t: #b91c1c; }
html[data-mode="dark"] .rq-card.age-ok { --rq-t: #4ade80; } html[data-mode="dark"] .rq-card.age-warn { --rq-t: #fbbf24; } html[data-mode="dark"] .rq-card.age-late { --rq-t: #f87171; }
.rq-card-h { display: flex; align-items: center; gap: 12px; }
.rq-av { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 15px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 19px; font-weight: 900; background: linear-gradient(135deg, hsl(var(--h), 75%, 48%), hsl(calc(var(--h) + 40), 75%, 58%)); }
.rq-who { flex: 1 1 auto; min-width: 0; }
.rq-name { display: block; font-size: 17px; font-weight: 900; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-sub { display: block; font-size: 13px; font-weight: 700; color: var(--app-muted); }
.rq-age { flex: 0 0 auto; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; color: var(--rq-t, var(--rq-c)); background: rgba(127,127,127,.14); background: color-mix(in srgb, var(--rq-c) 14%, transparent); white-space: nowrap; }
.rq-amt { display: flex; align-items: baseline; gap: 4px; margin: 10px 0 2px; font-size: 36px; font-weight: 900; line-height: 1.1; letter-spacing: -.5px; color: var(--app-ink); }
.rq-cur { font-size: 24px; color: var(--app-muted); font-weight: 800; }
.rq-mode { margin-left: auto; padding: 5px 11px; border-radius: 999px; font-style: normal; font-size: 12px; font-weight: 900; letter-spacing: .02em; background: rgba(var(--ui2-rgb), .12); color: var(--app-blue); align-self: center; }
.rq-facts { list-style: none; margin: 4px 0 2px; padding: 0; }
.rq-facts li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--app-line); font-size: 14px; }
.rq-facts li span { flex: 0 0 92px; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--app-muted); }
.rq-facts li b { flex: 1 1 auto; min-width: 0; font-weight: 800; word-break: break-all; }
.rq-copy { flex: 0 0 38px; width: 38px; height: 38px; border: 0; border-radius: 12px; background: rgba(var(--ui2-rgb), .12); color: var(--app-blue); font-size: 15px; }
.rq-copy:active { transform: scale(.92); }
.rq-shot { display: flex; align-items: center; gap: 12px; margin: 8px 0 2px; padding: 8px; border-radius: 16px; background: var(--app-tint); color: var(--app-ink) !important; text-decoration: none !important; }
.rq-shot img { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; object-position: top; background: var(--app-line); }
.rq-shot span { flex: 1 1 auto; font-size: 13px; font-weight: 800; }
.rq-shot em { flex: 0 0 auto; padding: 0 6px; color: var(--app-blue); font-style: normal; font-size: 16px; }
.rq-contact { display: flex; gap: 8px; margin: 10px 0; }
.rq-ic { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; border-radius: 13px; font-size: 13.5px; font-weight: 900; text-decoration: none !important; color: #fff !important; }
.rq-ic.call { background: #0d6efd; } .rq-ic.wa { background: #25d366; } .rq-ic.hist { background: rgba(var(--ui2-rgb), .13); color: var(--app-blue) !important; }
.rq-act { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }
.rq-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border: 0; border-radius: 17px; font-size: 17px; font-weight: 900; transition: transform .08s; }
.rq-btn:active { transform: scale(.96); }
.rq-btn.yes { background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff; box-shadow: 0 8px 18px rgba(34, 197, 94, .35); }
.rq-btn.no { background: rgba(239, 68, 68, .1); color: #dc2626; border: 2px solid rgba(239, 68, 68, .35); }
.rq-btn:disabled { opacity: .5; }
.rq-busy { opacity: .6; pointer-events: none; }
.rq-done-yes, .rq-done-no { animation: rqOut .38s ease forwards; pointer-events: none; }
.rq-done-yes::before { background: #22c55e; } .rq-done-no::before { background: #ef4444; }
@keyframes rqOut { 0% { opacity: 1; transform: none; max-height: 900px; } 55% { opacity: 0; transform: translateX(46px); max-height: 900px; } 100% { opacity: 0; transform: translateX(46px); max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }
.rq-skel i { display: block; height: 18px; margin: 14px 0; border-radius: 9px; background: linear-gradient(90deg, var(--app-line) 25%, rgba(255, 255, 255, .45) 37%, var(--app-line) 63%); background-size: 400% 100%; animation: rqShimmer 1.3s ease infinite; }
.rq-skel i:nth-child(1) { width: 62%; } .rq-skel i:nth-child(2) { width: 40%; height: 34px; } .rq-skel i:nth-child(3) { width: 100%; height: 56px; border-radius: 17px; }
@keyframes rqShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.rq-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 20px; text-align: center; border-radius: 22px; background: var(--app-card); box-shadow: 0 8px 22px var(--app-shadow); color: var(--app-muted); }
.rq-empty[hidden], .rq-more[hidden] { display: none; }
.rq-empty > i { font-size: 46px; color: #22c55e; }
.rq-empty b { font-size: 21px; font-weight: 900; color: var(--app-ink); }
.rq-more { margin: 10px 0 0; padding: 12px; border-radius: 14px; background: rgba(245, 158, 11, .14); color: #b45309; font-size: 13px; font-weight: 800; text-align: center; }
.rq-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin: 18px 0 8px; }
.rq-foot a { font-size: 14px; font-weight: 800; color: var(--app-blue); }

/* ================================================================ PHONE ONLY */
@media (max-width: 767.98px) {

  /* ---- colour: top bar, buttons, focus rings follow the chosen theme ---- */
  html body.app-shell .topbar { background: var(--ui2-grad) !important; box-shadow: 0 8px 22px rgba(var(--ui2-rgb), .38) !important; }
  html body.app-shell .app-fab { background: var(--ui2-grad) !important; border: 0 !important; box-shadow: 0 10px 24px rgba(var(--ui2-rgb), .5) !important; }
  html body.app-shell .btn-primary { background: var(--ui2-grad) !important; border-color: transparent !important; box-shadow: 0 6px 14px rgba(var(--ui2-rgb), .28); }
  html body.app-shell .btn-primary:active { filter: brightness(.92); }
  html body.app-shell .form-control:focus, html body.app-shell .dataTables_wrapper .dataTables_filter input:focus { border-color: var(--app-blue); box-shadow: 0 0 0 4px rgba(var(--ui2-rgb), .16); }
  html body.app-shell .dataTables_wrapper .paginate_button.active .page-link { background: var(--ui2-grad); color: #fff; }
  html body.app-shell .app-topbar-title { text-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
  html body.app-shell .card-header { position: relative; }
  html body.app-shell .card:not(.app-flat):not(.dashboard-summary-card) > .card-header::after { content: ''; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--ui2-grad); opacity: .85; }

  /* ---- bottom bar: pill indicator + badges ---- */
  html body.app-shell .app-tab { gap: 2px; }
  html body.app-shell .app-tab i { width: 56px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 16px; transition: background .2s, transform .2s; }
  html body.app-shell .app-tab.active i { background: rgba(var(--ui2-rgb), .15); transform: translateY(-1px); }
  html body.app-shell .app-tab.active::before { display: none; }
  html body.app-shell .app-tab.active span { color: var(--app-blue); }
  html body.app-shell .app-tile { position: relative; }
  html body.app-shell .app-tile .ui2-badge { left: auto; right: 8px; top: 8px; }
  html body.app-shell .app-tab .ui2-badge { top: 3px; left: calc(50% + 8px); }

  /* mode button next to the refresh button */
  html body.app-shell .ui2-modebtn { margin-left: 0; }

  /* ---- sticky search under the top bar + loading state ---- */
  html body.app-shell .dataTables_wrapper:has(table.app-cards) { overflow: visible !important; }
  html body.app-shell .dataTables_wrapper:has(table.app-cards) > .row:first-child { position: sticky; top: calc(var(--ui2-top, 62px) + 4px); z-index: 25; padding: 4px 0 0; background: var(--app-bg); }
  html body.app-shell .dataTables_wrapper.ui2-loading table.app-cards tbody { opacity: .4; transition: opacity .15s; }
  html body.app-shell div.dataTables_wrapper div.dataTables_processing {
    position: fixed !important; top: calc(var(--ui2-top, 62px) + 76px) !important; left: 50% !important; width: 150px !important; margin: 0 0 0 -75px !important; padding: 9px 0 !important;
    z-index: 30; border: 0; border-radius: 999px; background: var(--app-card); color: var(--app-blue); font-size: 13px; font-weight: 900; box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
  }

  /* ---- status colour stripe on every card ---- */
  html body.app-shell table.app-cards tbody tr.ui2-st-ok   { box-shadow: inset 7px 0 0 #22c55e, 0 8px 22px var(--app-shadow) !important; padding-left: 22px !important; }
  html body.app-shell table.app-cards tbody tr.ui2-st-warn { box-shadow: inset 7px 0 0 #f59e0b, 0 8px 22px var(--app-shadow) !important; padding-left: 22px !important; }
  html body.app-shell table.app-cards tbody tr.ui2-st-bad  { box-shadow: inset 7px 0 0 #ef4444, 0 8px 22px var(--app-shadow) !important; padding-left: 22px !important; }
  html body.app-shell table.app-cards tbody td.app-status .badge { box-shadow: 0 3px 8px rgba(0, 0, 0, .12); }
  html body.app-shell table.app-cards tbody td[data-label="Credit" i], html body.app-shell table.app-cards tbody td[data-label="Win Amount" i], html body.app-shell table.app-cards tbody td[data-label="Win" i] { color: #16a34a !important; }
  html body.app-shell table.app-cards tbody td[data-label="Debit" i], html body.app-shell table.app-cards tbody td[data-label="Loss" i] { color: #dc2626 !important; }

  /* ---- call / WhatsApp / copy buttons inside cards ---- */
  html body.app-shell table.app-cards tbody td.ui2-has-ic { justify-content: flex-end !important; }
  html body.app-shell table.app-cards tbody td.ui2-has-ic::before { margin-right: auto !important; }
  .ui2-ic-row { display: inline-flex; gap: 6px; margin-left: 4px; flex: 0 0 auto; }
  .ui2-ic { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; color: #fff !important; font-size: 16px; text-decoration: none !important; }
  .ui2-ic.call { background: #0d6efd; } .ui2-ic.wa { background: #25d366; }
  .ui2-ic.cp { background: rgba(var(--ui2-rgb), .13); color: var(--app-blue) !important; }
  .ui2-ic:active { transform: scale(.92); }

  /* ---- dashboard ---- */
  .ui2-hero { margin: 0 0 6px; }
  .ui2-hello b { display: block; font-size: 23px; font-weight: 900; line-height: 1.15; color: var(--app-ink); }
  .ui2-hello span { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--app-muted); }
  .ui2-ptiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
  .ui2-ptile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 15px 14px 13px; overflow: hidden; border-radius: 22px; color: #fff !important; text-decoration: none !important; box-shadow: 0 12px 26px rgba(0, 0, 0, .2); }
  .ui2-ptile.dep { background: linear-gradient(135deg, #047857 0%, #10b981 60%, #34d399 100%); }
  .ui2-ptile.wd  { background: linear-gradient(135deg, #c2410c 0%, #f97316 58%, #fbbf24 100%); }
  .ui2-ptile.off { display: none; }
  .ui2-ptile > i { position: absolute; right: -8px; top: -8px; width: auto; height: auto; font-size: 64px; opacity: .17; }
  .ui2-ptile b { font-size: 36px; font-weight: 900; line-height: 1.05; }
  .ui2-ptile span { font-size: 11.5px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; opacity: .96; }
  .ui2-ptile em { min-height: 1.25em; font-style: normal; font-size: 13px; font-weight: 800; opacity: .92; }
  .ui2-ptile.has::after { content: ''; position: absolute; bottom: 16px; right: 16px; width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: ui2Ping 1.6s infinite; }
  .ui2-ptile:active { transform: scale(.98); }
  .ui2-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 4px; margin: 14px 0 16px; padding: 16px 6px 12px; border-radius: 22px; background: var(--app-card); box-shadow: 0 8px 22px var(--app-shadow); }
  .ui2-q { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--app-ink) !important; font-size: 11.5px; font-weight: 800; text-decoration: none !important; }
  .ui2-q i { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 17px; color: #fff; font-size: 20px; box-shadow: 0 7px 14px rgba(0, 0, 0, .18); }
  .ui2-q:active i { transform: scale(.92); }
  html body.app-shell .dashboard-summary-card { box-shadow: 0 10px 22px rgba(0, 0, 0, .16) !important; }
  html body.app-shell #myChart, html body.app-shell #LastMonthChart { padding: 12px; border-radius: 20px; background: var(--app-card); box-shadow: 0 8px 22px var(--app-shadow); max-height: 280px; }
  html body.app-shell .ui2-pill { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 13px 16px; border-radius: 18px; background: var(--ui2-grad); color: #fff !important; text-decoration: none !important; box-shadow: 0 8px 20px rgba(var(--ui2-rgb), .3); }
  html body.app-shell .ui2-pill > i { font-size: 20px; }
  html body.app-shell .ui2-pill span { flex: 1 1 auto; font-size: 14px; font-weight: 800; }
  html body.app-shell .ui2-pill b { font-size: 20px; font-weight: 900; margin-right: 2px; }
  html body.app-shell .ui2-pill u { text-decoration: none; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: 12px; font-weight: 900; white-space: nowrap; }

  /* ---- Requests page on the phone ---- */
  html body.app-shell .rq-seg { position: sticky; top: calc(var(--ui2-top, 62px) + 4px); z-index: 25; }
  html body.app-shell .rq-list { grid-template-columns: 1fr; gap: 12px; }
  html body.app-shell .rq-foot { padding-bottom: 8px; }

  /* ---- look & feel panel inside the More sheet ---- */
  .ui2-prefs { margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--app-line); }
  .ui2-prefs-t { margin: 14px 4px 8px; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--app-muted); }
  .ui2-swatches { display: flex; gap: 12px; padding: 2px 4px 4px; }
  .ui2-swatch { position: relative; flex: 1 1 0; height: 44px; max-width: 54px; padding: 0; border: 3px solid transparent; border-radius: 50%; background: var(--c); box-shadow: 0 4px 10px rgba(0, 0, 0, .2); }
  .ui2-swatch i { display: none; color: #fff; font-size: 16px; }
  .ui2-swatch.on { border-color: var(--app-card); box-shadow: 0 0 0 3px var(--c), 0 6px 14px rgba(0, 0, 0, .25); }
  .ui2-swatch.on i { display: inline; }
  .ui2-seg { display: flex; gap: 6px; padding: 5px; border-radius: 16px; background: var(--app-tint); }
  .ui2-seg button { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--app-muted); font-size: 14px; font-weight: 900; }
  .ui2-seg button.on { background: var(--app-card); color: var(--app-blue); box-shadow: 0 3px 10px rgba(0, 0, 0, .15); }
  html body.app-shell label.ui2-switch { position: relative; display: flex; align-items: center; gap: 12px; margin: 0 !important; padding: 12px 4px; border-top: 1px solid var(--app-line); font-size: 15px; }
  .ui2-switch:first-of-type { border-top: 0; }
  .ui2-switch span { flex: 1 1 auto; }
  .ui2-switch b { display: block; font-size: 15px; font-weight: 900; color: var(--app-ink); }
  .ui2-switch small { display: block; margin-top: 1px; font-size: 12px; font-weight: 700; line-height: 1.3; color: var(--app-muted); }
  .ui2-switch input { position: absolute; opacity: 0; pointer-events: none; }
  .ui2-switch > i { position: relative; flex: 0 0 auto; width: 50px; height: 30px; border-radius: 15px; background: #cbd5e1; transition: background .2s; }
  .ui2-switch > i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .3); transition: transform .2s; }
  .ui2-switch input:checked + i { background: var(--app-blue); }
  .ui2-switch input:checked + i::after { transform: translateX(20px); }
  html body.app-shell label.ui2-switch.ui2-sub { margin-left: 14px !important; padding: 8px 4px; }
  html body.app-shell label.ui2-switch.ui2-sub b { font-size: 14px; font-weight: 800; }

  /* ================================================================ DARK MODE (phone) */
  html[data-mode="dark"] body.app-shell, html[data-mode="dark"] body.app-shell #content-wrapper { background: var(--app-bg) !important; color: var(--app-ink); }
  html[data-mode="dark"] body.app-shell .card:not(.dashboard-summary-card), html[data-mode="dark"] body.app-shell .card-body, html[data-mode="dark"] body.app-shell .card-header { background: var(--app-card) !important; color: var(--app-ink); border-color: var(--app-line) !important; }
  html[data-mode="dark"] body.app-shell .card.app-flat, html[data-mode="dark"] body.app-shell .card.app-flat > .card-body, html[data-mode="dark"] body.app-shell .card.app-flat > .card-header { background: transparent !important; }
  html[data-mode="dark"] body.app-shell .dashboard-summary-card .card-body { background: transparent !important; }
  html[data-mode="dark"] body.app-shell .app-bottom-nav { background: var(--app-card); border-top-color: var(--app-line); box-shadow: 0 -10px 28px rgba(0, 0, 0, .4); }
  html[data-mode="dark"] body.app-shell .app-tab { color: var(--app-muted); }
  html[data-mode="dark"] body.app-shell .app-tab:active { background: var(--app-tint); }
  html[data-mode="dark"] body.app-shell .app-sheet, html[data-mode="dark"] body.app-shell .custom-modal .modal-content, html[data-mode="dark"] body.app-shell .custom-modal2 .modal-content { background: var(--app-card); color: var(--app-ink); }
  html[data-mode="dark"] body.app-shell .app-sheet-handle, html[data-mode="dark"] body.app-shell .custom-modal .modal-header::before, html[data-mode="dark"] body.app-shell .custom-modal2 .modal-header::before { background: #3a4a68; }
  html[data-mode="dark"] body.app-shell .app-tile { background: var(--app-tint); }
  html[data-mode="dark"] body.app-shell .app-tile:active { background: #26364f; }
  html[data-mode="dark"] body.app-shell .custom-modal .modal-footer, html[data-mode="dark"] body.app-shell .custom-modal2 .modal-footer { background: var(--app-card); box-shadow: 0 -8px 18px rgba(0, 0, 0, .3); }
  html[data-mode="dark"] body.app-shell .modal-header, html[data-mode="dark"] body.app-shell .modal-footer { border-color: var(--app-line); }
  html[data-mode="dark"] body.app-shell .modal-title, html[data-mode="dark"] body.app-shell .close, html[data-mode="dark"] body.app-shell h1, html[data-mode="dark"] body.app-shell h2, html[data-mode="dark"] body.app-shell h3,
  html[data-mode="dark"] body.app-shell h4, html[data-mode="dark"] body.app-shell h5, html[data-mode="dark"] body.app-shell h6, html[data-mode="dark"] body.app-shell .text-gray-800, html[data-mode="dark"] body.app-shell .text-gray-900 { color: var(--app-ink) !important; text-shadow: none; }
  html[data-mode="dark"] body.app-shell .text-gray-600, html[data-mode="dark"] body.app-shell .text-gray-700, html[data-mode="dark"] body.app-shell .text-muted, html[data-mode="dark"] body.app-shell small { color: var(--app-muted) !important; }
  html[data-mode="dark"] body.app-shell .text-custom { color: var(--app-ink) !important; }
  html[data-mode="dark"] body.app-shell .form-control, html[data-mode="dark"] body.app-shell .custom-select, html[data-mode="dark"] body.app-shell select.form-control, html[data-mode="dark"] body.app-shell textarea.form-control,
  html[data-mode="dark"] body.app-shell .input-group-text { background-color: var(--app-field) !important; border-color: var(--app-line) !important; color: var(--app-ink) !important; }
  html[data-mode="dark"] body.app-shell .form-control::placeholder, html[data-mode="dark"] body.app-shell .rq-search input::placeholder { color: var(--app-muted); opacity: 1; }
  html[data-mode="dark"] body.app-shell .form-control:disabled, html[data-mode="dark"] body.app-shell .form-control[readonly] { background-color: var(--app-tint) !important; opacity: .8; }
  html[data-mode="dark"] body.app-shell label:not(.custom-control-label):not(.form-check-label):not(.btn) { color: var(--app-ink); }
  html[data-mode="dark"] body.app-shell .dataTables_wrapper .dataTables_filter input { background-color: var(--app-field); border-color: var(--app-line); color: var(--app-ink); }
  html[data-mode="dark"] body.app-shell .dataTables_wrapper .page-link { background: var(--app-card); box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
  html[data-mode="dark"] body.app-shell table.app-cards tbody tr { background: var(--app-card) !important; box-shadow: 0 8px 22px rgba(0, 0, 0, .35) !important; }
  html[data-mode="dark"] body.app-shell table.app-cards tbody tr.ui2-st-ok   { box-shadow: inset 7px 0 0 #22c55e, 0 8px 22px rgba(0, 0, 0, .35) !important; }
  html[data-mode="dark"] body.app-shell table.app-cards tbody tr.ui2-st-warn { box-shadow: inset 7px 0 0 #f59e0b, 0 8px 22px rgba(0, 0, 0, .35) !important; }
  html[data-mode="dark"] body.app-shell table.app-cards tbody tr.ui2-st-bad  { box-shadow: inset 7px 0 0 #ef4444, 0 8px 22px rgba(0, 0, 0, .35) !important; }
  html[data-mode="dark"] body.app-shell table.app-cards tbody td.dataTables_empty, html[data-mode="dark"] body.app-shell table.app-cards tbody tr.app-empty { background: var(--app-card) !important; }
  html[data-mode="dark"] body.app-shell table.app-cards tbody td { color: var(--app-ink) !important; }
  html[data-mode="dark"] body.app-shell table.app-cards tbody td[data-label="Amount" i], html[data-mode="dark"] body.app-shell table.app-cards tbody td[data-label="Balance" i], html[data-mode="dark"] body.app-shell table.app-cards tbody td[data-label="Profit" i] { color: var(--app-blue) !important; }
  html[data-mode="dark"] body.app-shell table.app-cards tbody td[data-label="Credit" i], html[data-mode="dark"] body.app-shell table.app-cards tbody td[data-label="Win Amount" i], html[data-mode="dark"] body.app-shell table.app-cards tbody td[data-label="Win" i] { color: #4ade80 !important; }
  html[data-mode="dark"] body.app-shell table.app-cards tbody td[data-label="Debit" i], html[data-mode="dark"] body.app-shell table.app-cards tbody td[data-label="Loss" i] { color: #f87171 !important; }
  html[data-mode="dark"] body.app-shell table.app-cards .inline-status-wrap .btn-group { background: var(--app-tint) !important; }
  html[data-mode="dark"] body.app-shell .btn-light, html[data-mode="dark"] body.app-shell .btn-secondary { background: var(--app-tint) !important; border-color: var(--app-line) !important; color: var(--app-ink) !important; }
  html[data-mode="dark"] body.app-shell .btn-outline-secondary, html[data-mode="dark"] body.app-shell .btn-outline-dark { color: var(--app-ink); border-color: var(--app-line); }
  html[data-mode="dark"] body.app-shell .dropdown-menu { background: var(--app-card); color: var(--app-ink); }
  html[data-mode="dark"] body.app-shell .dropdown-item { color: var(--app-ink); }
  html[data-mode="dark"] body.app-shell .dropdown-item:hover, html[data-mode="dark"] body.app-shell .dropdown-item:focus { background: var(--app-tint); }
  html[data-mode="dark"] body.app-shell .jconfirm .jconfirm-box { background: var(--app-card) !important; color: var(--app-ink); }
  html[data-mode="dark"] body.app-shell .jconfirm .jconfirm-box .jconfirm-title-c .jconfirm-title, html[data-mode="dark"] body.app-shell .jconfirm .jconfirm-box .jconfirm-content { color: var(--app-ink) !important; }
  html[data-mode="dark"] body.app-shell .table, html[data-mode="dark"] body.app-shell .table td, html[data-mode="dark"] body.app-shell .table th { color: var(--app-ink); border-color: var(--app-line); }
  html[data-mode="dark"] body.app-shell .table-striped tbody tr:nth-of-type(odd) { background-color: rgba(255, 255, 255, .03); }
  html[data-mode="dark"] body.app-shell .bg-white, html[data-mode="dark"] body.app-shell .list-group-item { background: var(--app-card) !important; color: var(--app-ink); }
  html[data-mode="dark"] body.app-shell hr { border-color: var(--app-line); }
  html[data-mode="dark"] body.app-shell .bootstrap-datetimepicker-widget, html[data-mode="dark"] body.app-shell .bootstrap-datetimepicker-widget table td, html[data-mode="dark"] body.app-shell .bootstrap-datetimepicker-widget .list-unstyled { background: var(--app-card); color: var(--app-ink); }
  html[data-mode="dark"] body.app-shell .topbar .dropdown-menu .dropdown-item { color: var(--app-ink); }
  html[data-mode="dark"] body.app-shell .ui2-swatch.on { border-color: var(--app-card); }
  html[data-mode="dark"] body.app-shell .rq-btn.no { background: rgba(239, 68, 68, .16); color: #fca5a5; }
  html[data-mode="dark"] body.app-shell .app-sortbar .users-table-head-sort { background: var(--app-card) !important; color: var(--app-ink) !important; }

  /* ---- readable text on coloured chips and buttons ---- */
  html body.app-shell .badge-warning { background-color: #fbbf24 !important; color: #422006 !important; }
  html body.app-shell .badge-success { background-color: #15803d !important; color: #fff !important; }
  html body.app-shell .badge-danger { background-color: #dc2626 !important; color: #fff !important; }
  html body.app-shell .badge-info { background-color: #0e7490 !important; color: #fff !important; }
  html body.app-shell .btn-success { background: linear-gradient(135deg, #15803d, #16a34a) !important; border-color: transparent !important; color: #fff !important; }
  html body.app-shell .btn-info { background: #0e7490 !important; border-color: #0e7490 !important; color: #fff !important; }
  html body.app-shell .btn-warning { color: #422006 !important; }
  html body.app-shell table.app-cards .inline-status-wrap .inline-status-select[data-status="pending"] { background: #fbbf24 !important; color: #422006 !important; }
  html body.app-shell table.app-cards .inline-status-wrap .inline-status-select[data-status="approved"] { background: #15803d !important; color: #fff !important; }
  html body.app-shell table.app-cards .inline-status-wrap .inline-status-select[data-status="canceled"] { background: #dc2626 !important; color: #fff !important; }
  html body.app-shell .rq-ic.wa { background: #128c7e; }
  html body.app-shell .rq-ic.call { background: #1d4ed8; }

  /* ---- page-specific boxes the stage-1 screens draw in light colours ---- */
  html[data-mode="dark"] body.app-shell .users-total-balance { background: var(--app-card) !important; border-color: var(--app-line) !important; box-shadow: 0 6px 18px rgba(0, 0, 0, .3) !important; }
  html[data-mode="dark"] body.app-shell .users-total-balance-label { color: var(--app-muted) !important; }
  html[data-mode="dark"] body.app-shell .users-total-balance-value, html[data-mode="dark"] body.app-shell .category-mobile-primary { color: var(--app-ink) !important; }
  html[data-mode="dark"] body.app-shell .category-mobile-secondary { color: var(--app-muted) !important; }
  html[data-mode="dark"] body.app-shell .users-sort-arrow-btn { background: var(--app-tint) !important; border-color: var(--app-line) !important; color: var(--app-ink) !important; }
}
