/* ==========================================================================
   CONTROL SITE — GREEN & BLACK STAFF ADMIN THEME (Night & Day Mode)
   Preserves all original processes, IDs, classes, forms, modals & scripts.
   ========================================================================== */

@view-transition{ navigation: auto; }
@media (prefers-reduced-motion: reduce){ @view-transition{ navigation: none; } }

/* ===============================
   NIGHT MODE (DEFAULT — SLEEK GREEN & BLACK)
   =============================== */
:root{
  --bg: #040806;
  --bg-2: #08110D;
  --card: #0B1511;
  --card-solid: #0B1511;
  --card-2: #08110D;
  --card-hover: #10201A;
  --border: rgba(52, 211, 153, 0.15);
  --border-strong: rgba(52, 211, 153, 0.28);
  --highlight: rgba(255, 255, 255, 0.08);

  --text: #F0FDF4;
  --muted: #94A39B;
  --dim: #64746C;

  --indigo: #10B981;
  --indigo-light: #34D399;
  --indigo-dark: #059669;
  --violet: #16A34A;
  --cyan: #22C55E;
  --cyan-light: #4ADE80;
  --indigo-soft: rgba(16, 185, 129, 0.18);

  --blue: #22C55E;
  --orange: #F59E0B;
  --pink: #F43F5E;
  --teal: #10B981;
  --green: #22C55E;
  --red: #F43F5E;

  --shadow-lg: 0 22px 54px rgba(0, 0, 0, 0.62);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);

  --page-bg:
    radial-gradient(920px 520px at 6% -6%, rgba(16, 185, 129, 0.20), transparent 60%),
    radial-gradient(780px 460px at 94% 4%, rgba(34, 197, 94, 0.13), transparent 58%),
    linear-gradient(180deg, #050B08 0%, #020504 100%);
  --side-bg: linear-gradient(180deg, #0B1611 0%, #060C09 100%);
  --main-bg: linear-gradient(180deg, #0A1410 0%, #050A08 100%);
  --clock-bg: linear-gradient(155deg, #0E2219 0%, #060E0A 100%);
  --table-wrap-bg: #050B08;
  --thead-bg: linear-gradient(180deg, #0F1F18, #0A1510);
  --input-bg: #060D0A;
  --modal-bg: linear-gradient(180deg, #0D1C15 0%, #060D0A 100%);
  --pill-bg: #0A1410;
  --seg-bg: #050A07;

  color-scheme: dark;
}

/* ===============================
   DAY MODE (LIGHT — CRISP WHITE & EMERALD GREEN)
   =============================== */
html[data-theme="light"]{
  --bg: #F3F7F5;
  --bg-2: #E6EFEA;
  --card: #FFFFFF;
  --card-solid: #FFFFFF;
  --card-2: #F8FBFA;
  --card-hover: #ECFDF5;
  --border: rgba(15, 23, 20, 0.10);
  --border-strong: rgba(15, 23, 20, 0.20);
  --highlight: rgba(255, 255, 255, 0.90);

  --text: #0A1410;
  --muted: #475850;
  --dim: #64746C;

  --indigo: #059669;
  --indigo-light: #059669;
  --indigo-dark: #047857;
  --cyan: #16A34A;
  --cyan-light: #16A34A;
  --indigo-soft: rgba(16, 185, 129, 0.13);

  --shadow-lg: 0 18px 42px rgba(10, 20, 16, 0.08);
  --shadow-md: 0 8px 22px rgba(10, 20, 16, 0.06);

  --page-bg:
    radial-gradient(920px 520px at 6% -6%, rgba(16, 185, 129, 0.12), transparent 58%),
    radial-gradient(780px 460px at 94% 4%, rgba(34, 197, 94, 0.10), transparent 56%),
    linear-gradient(180deg, #F7FBF9 0%, #EDF4F0 100%);
  --side-bg: linear-gradient(180deg, #FFFFFF 0%, #F7FBF9 100%);
  --main-bg: linear-gradient(180deg, #FFFFFF 0%, #FAFCFB 100%);
  --clock-bg: linear-gradient(155deg, #ECFDF5 0%, #DCFCE7 100%);
  --table-wrap-bg: #FFFFFF;
  --thead-bg: linear-gradient(180deg, #F8FBFA, #EDF4F0);
  --input-bg: #FFFFFF;
  --modal-bg: linear-gradient(180deg, #FFFFFF 0%, #F7FBF9 100%);
  --pill-bg: #FFFFFF;
  --seg-bg: #EDF4F0;

  color-scheme: light;
}

*{ box-sizing: border-box; }

html, body{ height: 100%; background-color: var(--bg); }
body{
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--page-bg);
  margin: 0;
  color: var(--text);
  overflow-y: auto;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

select, select option{ color: var(--text); background: var(--card-solid); }

.wrap{
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 14px;
  box-sizing: border-box;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===============================
   LAYOUT GRID (sidebar + main)
   =============================== */
.topbar{ flex: none; }
.grid{
  display: grid;
  gap: 16px;
  align-items: stretch;
  flex: 1;
  width: 100%;
}
@media(min-width:900px){
  .grid{ grid-template-columns: 280px minmax(0, 1fr); }
}

/* ===============================
   SIDEBAR
   =============================== */
.card.side{
  background: var(--side-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--highlight);
  display: flex;
  flex-direction: column;
  padding: 20px 15px;
  position: sticky;
  top: 14px;
  height: fit-content;
  min-height: calc(100vh - 28px);
}

.brand-block{
  display: flex; align-items: center; gap: 13px;
  padding: 6px 10px 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.brand-ico{
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #22C55E 0%, #059669 100%);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #fff;
  overflow: hidden;
}
.brand-title{ font-weight: 800; font-size: 16.5px; color: var(--text); line-height: 1.2; letter-spacing: -0.01em; }
.brand-sub{ font-size: 11.5px; color: var(--cyan); font-weight: 700; margin-top: 2px; letter-spacing: 0.03em; text-transform: uppercase; }

.menu-item{
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--muted);
  margin: 4px 0;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  transition: all .18s ease;
}
.menu-left{ display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-icon-wrap{
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all .18s ease;
}
.menu-icon-svg{ width: 20px; height: 20px; }
.menu-text{ font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-arrow{ opacity: .45; font-size: 15px; flex: none; transition: transform .18s ease, opacity .18s ease; }

.menu-item:hover{
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(52, 211, 153, 0.24);
  color: var(--text);
  transform: translateX(3px);
}
.menu-item:hover .menu-icon-wrap{
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--indigo-light);
}
.menu-item:hover .menu-arrow{ opacity: .9; transform: translateX(2px); }

.menu-item.active{
  background: linear-gradient(135deg, #22C55E 0%, #10B981 55%, #047857 100%);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.menu-item.active .menu-icon-wrap{
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
}
.menu-item.active .menu-arrow{ opacity: 1; }

/* ===== Sidebar clock ("Server Time") ===== */
.side-clock{ margin-top: auto; padding-top: 16px; }
.side-clock-inner{
  border-radius: 18px;
  padding: 15px;
  background: var(--clock-bg);
  border: 1px solid rgba(34, 197, 94, 0.28);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--highlight);
  display: flex; align-items: center; gap: 13px;
  position: relative; overflow: hidden;
}
.side-clock .sc-ico{
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.22), rgba(16, 185, 129, 0.16));
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--indigo-light); position: relative;
}
.side-clock .sc-body{ min-width: 0; position: relative; }
.side-clock .sc-label{
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--cyan);
}
.side-clock .sc-label::before{
  content: "";
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--green); box-shadow: 0 0 8px rgba(34, 197, 94, 0.9);
}
.side-clock .sc-time{ font-size: 21px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; margin-top: 3px; }
.side-clock .sc-date{ font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.side-clock .sc-country{ font-size: 11.5px; font-weight: 600; color: var(--dim); margin-top: 2px; }

/* ===============================
   TOPBAR + DAY / NIGHT ON-OFF SWITCH
   =============================== */
.topbar{ display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 18px; }

.theme-toggle{
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.20);
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  transition: all .2s ease;
  user-select: none;
}
.theme-toggle:hover{
  border-color: var(--indigo);
  transform: translateY(-1px);
}
.theme-toggle .tt-ico{
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #4ADE80;
}
html[data-theme="light"] .theme-toggle .tt-ico{
  background: rgba(245, 158, 11, 0.16);
  color: #D97706;
}
.theme-toggle .tt-track{
  width: 42px; height: 24px; border-radius: 999px;
  background: linear-gradient(135deg, #064E3B, #022C22);
  border: 1px solid rgba(52, 211, 153, 0.45);
  position: relative;
  transition: background .2s ease;
  flex: none;
}
.theme-toggle .tt-thumb{
  width: 18px; height: 18px; border-radius: 999px;
  background: linear-gradient(135deg, #4ADE80, #10B981);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  position: absolute; top: 2px; left: 2px;
  transition: transform .22s cubic-bezier(.22, 1, .36, 1), background .2s ease;
}
html[data-theme="light"] .theme-toggle .tt-track{
  background: linear-gradient(135deg, #FDE68A, #F59E0B);
  border-color: rgba(217, 119, 6, 0.4);
}
html[data-theme="light"] .theme-toggle .tt-thumb{
  transform: translateX(18px);
  background: #FFFFFF;
}
.theme-toggle .tt-state{
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(16, 185, 129, 0.18); color: var(--indigo-light);
}
html[data-theme="light"] .theme-toggle .tt-state{
  background: rgba(245, 158, 11, 0.16); color: #B45309;
}

.admin-pill{
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.20);
  cursor: pointer; transition: all .2s ease;
}
.admin-pill:hover{ border-color: var(--indigo); transform: translateY(-1px); }
.admin-avatar{
  width: 36px; height: 36px; border-radius: 999px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #22C55E, #059669);
  color: #fff; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.38);
}
.admin-name{ font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; }
.admin-role{ font-size: 11px; color: var(--cyan); font-weight: 700; line-height: 1.2; }
.admin-chev{ color: var(--muted); font-size: 12px; margin-left: 2px; }

.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: 12px;
  color: var(--text); text-decoration: none; font-weight: 700;
  border: 1px solid var(--border-strong);
  background: var(--card-2);
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: all .18s ease;
}
.btn:hover{ border-color: var(--indigo); background: var(--indigo-soft); }

/* ===============================
   CONTENT CARD
   =============================== */
.card{
  background: var(--main-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--highlight);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dashboard-card{ padding: 24px; min-width: 0; }

.card-h{
  padding: 0 0 20px;
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.h1{
  font-weight: 800; font-size: 26px; letter-spacing: -0.02em;
  color: var(--text);
}
.muted{ color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.dot{ width: 9px; height: 9px; border-radius: 999px; background: var(--green); box-shadow: 0 0 10px rgba(34, 197, 94, 0.75); }

/* ===============================
   UPGRADED TABLES (Green & Black)
   =============================== */
.table-wrap{
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--table-wrap-bg);
  box-shadow: var(--shadow-md);
}
table{ width: 100%; border-collapse: separate; border-spacing: 0; }

.dashboard-card table thead th{
  background: var(--thead-bg) !important;
  color: var(--muted) !important;
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 14px 10px !important;
  border-bottom: 1px solid var(--border-strong) !important;
  position: sticky; top: 0; z-index: 10;
}

.dashboard-card table tbody td{
  padding: 13px 10px;
  color: var(--text) !important;
  font-weight: 600;
  border-bottom: 1px solid var(--border) !important;
}
.dashboard-card table tbody tr:nth-child(even){
  background: rgba(52, 211, 153, 0.03) !important;
}
.dashboard-card table tbody tr:hover{
  background: rgba(16, 185, 129, 0.08) !important;
}

.users-table th:nth-child(-n+9),
.users-table td:nth-child(-n+9),
.dashboard-card #loanTable th,
.dashboard-card #loanTable td,
#withdrawalsTable th,
#withdrawalsTable td,
#pmTable th,
#pmTable td{
  border-right: 1px solid var(--border) !important;
}
.users-table th:nth-child(10), .users-table td:nth-child(10),
.users-table th:nth-child(11), .users-table td:nth-child(11),
.dashboard-card #loanTable th:last-child, .dashboard-card #loanTable td:last-child,
#withdrawalsTable th:last-child, #withdrawalsTable td:last-child,
#pmTable th:last-child, #pmTable td:last-child{
  border-right: 0 !important;
}

.dashboard-card table tbody td input,
.dashboard-card table tbody td select,
.dashboard-card table tbody td textarea{
  background: var(--input-bg) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 10px !important;
  padding: 8px 10px !important;
  color: var(--text) !important;
  font-weight: 600 !important;
  outline: none !important;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.dashboard-card table tbody td input:focus,
.dashboard-card table tbody td select:focus,
.dashboard-card table tbody td textarea:focus{
  border-color: var(--green) !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18) !important;
}

.users-table td.phone a.u-link,
.dashboard-card #loanTable td.col-phone a.u-link,
#withdrawalsTable td:nth-child(3),
#pmTable td:nth-child(2){
  color: #4ADE80 !important;
}

html[data-theme="light"] .users-table td.balance-cell input.balance-input,
html[data-theme="light"] .dashboard-card #loanTable td.col-amount{
  color: #0A1410 !important;
}
html[data-theme="light"] .dashboard-card #loanTable thead th.col-amount,
html[data-theme="light"] .dashboard-card #loanTable thead th.col-term{
  color: #475850 !important;
}
html[data-theme="light"] .users-table td.phone a.u-link,
html[data-theme="light"] .dashboard-card #loanTable td.col-phone a.u-link,
html[data-theme="light"] #withdrawalsTable td:nth-child(3),
html[data-theme="light"] #pmTable td:nth-child(2){
  color: #059669 !important;
}
html[data-theme="light"] .dashboard-card #loanTable td.col-term,
html[data-theme="light"] .dashboard-card #loanTable td.col-created{
  color: #33413B !important;
}

table a{ color: var(--indigo-light) !important; text-decoration: none; }
table a:hover{ text-decoration: underline; }

input, select, textarea{
  width: 100%; box-sizing: border-box;
  padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text);
  outline: none; font-family: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus, textarea:focus{
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.savebtn{
  padding: 11px 18px;
  min-width: 78px;
  border-radius: 12px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, #22C55E, #059669);
  color: #fff;
  cursor: pointer; font-family: inherit; font-weight: 700;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all .18s ease;
}
.savebtn:hover{ filter: brightness(1.08); transform: translateY(-1px); }
.savebtn:active{ transform: translateY(1px); }

.pw-btn{
  background: linear-gradient(135deg, #10B981, #047857) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.32) !important;
}
.del-user-btn, .wd-del{
  background: linear-gradient(135deg, #F43F5E, #BE123C) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 8px 18px rgba(244, 63, 94, 0.32) !important;
}

.pager{
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  padding: 16px 0 2px; font-size: 13px; color: var(--muted);
}
.pager a{
  padding: 7px 14px; border-radius: 10px;
  background: var(--indigo-soft);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: var(--indigo-light) !important; text-decoration: none; font-weight: 700;
  transition: all .18s ease;
}
.pager a:hover{ background: linear-gradient(135deg, #22C55E, #059669); color: #fff !important; text-decoration: none; }

.inline-form{ display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; }
.inline-form select{ width: auto !important; min-width: 180px; flex: 1 1 auto; }
.inline-form .savebtn{ flex: 0 0 auto; white-space: nowrap; }
.user-font{ font-family: inherit !important; font-weight: 600 !important; }

/* ===============================
   PERIOD FILTER PILLS
   =============================== */
.period-buttons{
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 6px; border-radius: 16px;
  background: var(--seg-bg);
  border: 1px solid var(--border);
}
.period-btn{
  padding: 8px 14px; border-radius: 11px;
  border: 1px solid transparent; background: transparent;
  color: var(--muted); font-size: 12.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all .18s ease;
}
.period-btn:hover{ color: var(--text); background: rgba(16, 185, 129, 0.10); }
.period-btn.active{
  background: linear-gradient(135deg, #22C55E 0%, #059669 100%);
  border-color: rgba(255, 255, 255, 0.25); color: #fff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.38);
}

/* ===============================
   MODALS (Green & Black)
   =============================== */
.logout-modal, #msgModal, .pw-modal, .modal{
  background: rgba(2, 6, 4, 0.76) !important;
}
.logout-modal{ position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 9999; padding: 18px 14px; }
.logout-modal.show{ display: flex; }

.logout-box, #msgModal .modal-box, .pw-box, .modal-card, #bankModal > div{
  background: var(--modal-bg) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 20px !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55) !important;
  color: var(--text) !important;
}
#bankModal > div > div:first-child > div > div:first-child{
  color: var(--text) !important;
}
#bankModalSub{
  color: var(--muted) !important;
  opacity: 1 !important;
}
.modal-save{
  background: linear-gradient(135deg, #22C55E, #059669) !important;
  color: #fff !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35) !important;
}
.modal-msg{
  color: #4ADE80 !important;
}
html[data-theme="light"] .modal-msg{
  color: #059669 !important;
}
.staff-toast{
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #22C55E, #059669);
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.45);
  transition: opacity .25s ease, transform .25s ease;
}
.logout-box{ width: min(420px, 92vw); padding: 22px; }
.logout-title{ font-weight: 800; font-size: 17px; margin-bottom: 6px; color: var(--text); }
.logout-text{ font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-bottom: 18px; }
.logout-actions{ display: flex; gap: 10px; justify-content: flex-end; }
.btn-cancel{
  height: 40px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--card-2);
  color: var(--text); font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn-confirm{
  height: 40px; padding: 0 18px; border-radius: 12px; border: 0;
  font-weight: 700; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, #F43F5E, #BE123C);
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.36); color: #fff;
}

.pw-head, .modal-head{
  background: var(--card-2) !important;
  border-bottom: 1px solid var(--border) !important;
}
.pw-title, .modal-title{ color: var(--text) !important; }
.modal-sub{ color: var(--muted) !important; }
.pw-label, .modal-label{ color: var(--muted) !important; }
.pw-input, .modal-input{
  background: var(--input-bg) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text) !important;
}
.pw-actions{ border-top: 1px solid var(--border) !important; }
.pw-x{ background: rgba(52, 211, 153, 0.14) !important; color: var(--text) !important; }
.pw-x:hover{ background: rgba(244, 63, 94, 0.25) !important; }

.st-box{
  background: var(--modal-bg) !important;
  border: 1px solid rgba(34, 197, 94, 0.35) !important;
  border-radius: 22px !important;
}
.st-head, .st-foot{
  background: var(--card-2) !important;
  border-color: var(--border) !important;
}
.st-title{ color: var(--text) !important; }

#msgModal{ position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 9999; }
#msgModal .modal-box{ width: min(720px, 94vw); padding: 22px; }
#msgModal h3{ margin: 0 0 12px; font-weight: 800; color: var(--text); }
#msgTextarea{
  width: 100%; max-width: 100%; min-height: 160px; resize: vertical;
  padding: 12px 14px; box-sizing: border-box; border-radius: 14px;
  border: 1px solid var(--border-strong); background: var(--input-bg);
  color: var(--text); font-family: inherit; font-size: 14px; line-height: 1.5; outline: none;
}
#msgTextarea:focus{ border-color: var(--green); }
#msgModal .modal-actions{ display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ===============================
   RESPONSIVE & ANIMATIONS
   =============================== */
@media (max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
  .card.side{ position: static; min-height: auto; }
  table{ table-layout: auto; }
}
@media (max-width: 560px){
  .topbar{ flex-wrap: wrap; }
  .dashboard-card{ padding: 16px; }
}

@keyframes fadeSlideUp{
  from{ transform: translateY(14px); opacity: 0; }
  to  { transform: translateY(0);    opacity: 1; }
}
.card-anim, .card-anim-left, .pill-anim-top{ animation: fadeSlideUp 420ms ease-out both; }
body.no-welcome-anim .card-anim,
body.no-welcome-anim .card-anim-left,
body.no-welcome-anim .pill-anim-top{
  animation: none !important; opacity: 1 !important; transform: none !important;
}

.staff-flash-stack{ display: grid; gap: 8px; margin: 0 0 14px; }
.staff-flash{ padding: 12px 15px; border-radius: 12px; font-size: 13.5px; font-weight: 700; line-height: 1.4; border: 1px solid transparent; }
.staff-flash.success{ background: rgba(16, 185, 129, 0.14); border-color: rgba(52, 211, 153, 0.35); color: #10B981; }
.staff-flash.info{    background: rgba(34, 197, 94, 0.14);  border-color: rgba(34, 197, 94, 0.35);  color: #22C55E; }
.staff-flash.warning{ background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.35); color: #D97706; }
.staff-flash.error{   background: rgba(244, 63, 94, 0.14);  border-color: rgba(244, 63, 94, 0.35);  color: #E11D48; }

/* ===============================
   UPGRADED GREEN & BLACK SCROLLBARS (GLOBAL + TABLES)
   =============================== */
*{
  scrollbar-width: thin;
  scrollbar-color: #10B981 #060D0A;
}
html[data-theme="light"] *{
  scrollbar-color: #10B981 #E6EFEA;
}

::-webkit-scrollbar{
  width: 11px;
  height: 12px;
}
::-webkit-scrollbar-track{
  background: #060D0A;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.14);
}
::-webkit-scrollbar-thumb{
  background: linear-gradient(90deg, #059669, #10B981, #22C55E);
  border-radius: 999px;
  border: 2px solid #060D0A;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
}
::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(90deg, #10B981, #22C55E, #4ADE80);
}
::-webkit-scrollbar-corner{
  background: #060D0A;
}

html[data-theme="light"] ::-webkit-scrollbar-track{
  background: #E6EFEA;
  border-color: rgba(5, 150, 105, 0.18);
}
html[data-theme="light"] ::-webkit-scrollbar-thumb{
  background: linear-gradient(90deg, #059669, #10B981, #22C55E);
  border: 2px solid #E6EFEA;
}

/* ===============================
   ALWAYS-VISIBLE PINNED BOTTOM HORIZONTAL SCROLLBAR FOR TABLES
   =============================== */
.table-sticky-hscroll{
  position: fixed;
  bottom: 10px;
  z-index: 950;
  height: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 999px;
  background: rgba(6, 13, 10, 0.94);
  border: 1px solid rgba(52, 211, 153, 0.32);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 14px rgba(16, 185, 129, 0.22);
  padding: 2px 4px;
  display: none;
}
html[data-theme="light"] .table-sticky-hscroll{
  background: rgba(248, 251, 250, 0.96);
  border-color: rgba(5, 150, 105, 0.34);
  box-shadow: 0 6px 20px rgba(10, 20, 16, 0.14);
}
.table-sticky-hscroll.visible{
  display: block;
}
.table-sticky-hscroll-inner{
  height: 1px;
}
.table-sticky-hscroll::-webkit-scrollbar{
  height: 12px;
}
.table-sticky-hscroll::-webkit-scrollbar-track{
  background: transparent;
  border: 0;
}
.table-sticky-hscroll::-webkit-scrollbar-thumb{
  background: linear-gradient(90deg, #059669, #10B981, #22C55E);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.table-sticky-hscroll::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(90deg, #10B981, #22C55E, #4ADE80);
  background-clip: padding-box;
}
