/* Page shell */
.crm-shell{ max-width:1280px; margin:24px auto; padding:0 24px; font:14px/1.6 Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif }
.page-header h1{ font-size:28px; margin:0 0 6px }
.muted{ color:#6b7280 }

/* Cards & buttons (reuse your existing styles) */
.card{ background:#fff; border:1px solid #e5e7eb; border-radius:14px; padding:16px; box-shadow:0 1px 2px rgba(0,0,0,.05); margin-bottom:16px }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:10px 16px; border-radius:8px; font-weight:600; border:1px solid #d1d5db; cursor:pointer }
.btn.primary{ background:#111827; color:#fff; border-color:#111827 }
.btn.ghost{ background:#f3f4f6; color:#111827 }
.btn.danger{ background:#ef4444; border-color:#ef4444; color:#fff }
.btn.small{ padding:6px 10px; font-size:12px }

/* Inputs */
label span{ display:block; font-size:12px; color:#475569; margin-bottom:6px; font-weight:600 }
.input{ width:100%; padding:10px 12px; border:1px solid #d1d5db; border-radius:10px; }

/* Summary grid */
.stats-grid{ display:grid; grid-template-columns:repeat(3, minmax(220px,1fr)); gap:16px; margin-bottom:16px }
.stat-card{ background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:16px }
.stat-card .title{ font-weight:700; color:#0f172a; margin-bottom:8px }
.stat-card .amount{ font-size:22px; font-weight:800; color:#0f172a }
.stat-card .amount.blue{ color:#2563eb }
.stat-card .amount.red{ color:#dc2626 }
.stat-card .amount.orange{ color:#ea580c }
.stat-card .sub{ font-size:12px; color:#6b7280 }
@media (max-width:960px){ .stats-grid{ grid-template-columns:1fr 1fr } }
@media (max-width:640px){ .stats-grid{ grid-template-columns:1fr } }

/* Tabs */
.tabs{ display:flex; gap:8px; margin:8px 0 12px }
.tab{ padding:10px 14px; border-radius:10px; background:#f3f4f6; border:1px solid #e5e7eb; font-weight:600; cursor:pointer }
.tab.active{ background:#111827; border-color:#111827; color:#fff }
.tab-panel.hidden{ display:none }

/* Forms */
.form-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px }
.form-grid .span-2{ grid-column:span 2 }
@media (max-width:700px){ .form-grid .span-2{ grid-column:span 1 } }

/* Tables */
.table-wrap{ overflow:auto }
.tbl{ width:100%; border-collapse:separate; border-spacing:0; font-size:13px }
.tbl th,.tbl td{ padding:10px 12px; border-bottom:1px solid #eef2f7; text-align:left }
.tbl th{ background:#f8fafc; position:sticky; top:0; z-index:1 }
.tbl td.num{ text-align:right }
.pos{ color:#065f46; font-weight:700 }
.neg{ color:#b91c1c; font-weight:700 }

/* Filter bar */
.filter-bar{ margin-bottom:12px }
.filter-grid{ display:grid; grid-template-columns:repeat(3,minmax(160px,1fr)); gap:12px; align-items:end }
.filter-actions{ display:flex; gap:10px }
@media (max-width:900px){ .filter-grid{ grid-template-columns:1fr 1fr } .filter-actions{ grid-column:1 / -1 } }

/* --- Form overlap fixes --- */
.crm-shell{ overflow-x:hidden; }               /* no stray horizontal scroll */
.form-grid{
  display:grid;
  gap:12px;
  grid-auto-rows:minmax(44px,auto);           /* enough row height */
}
.form-grid > label{
  display:flex;                                /* label becomes a column */
  flex-direction:column;
  min-width:0;                                 /* allow shrink inside grid */
}
label span{ line-height:1.2; }

/* All inputs fill their grid cell and never overflow */
.input, select.input{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
}

/* Deposit form: 4 columns on large, wrap down responsively */
.deposit-grid{
  grid-template-columns: 1.2fr 0.8fr 1fr 1fr;  /* ID | Date | A | B */
  align-items:end;                              /* bottoms line up nicely */
}
.deposit-grid .span-2{ grid-column:1 / -1; }   /* Bonus % spans full row */

/* Withdrawal form: 3 columns on large */
.withdraw-grid{
  grid-template-columns: 1.2fr 0.8fr 1fr;      /* Entry | Date | Amount */
  align-items:end;
}
.withdraw-grid .span-2{ grid-column:1 / -1; }

/* Medium screens: two columns */
@media (max-width: 1024px){
  .deposit-grid{   grid-template-columns: 1fr 1fr; }
  .withdraw-grid{  grid-template-columns: 1fr 1fr; }
}

/* Small screens: single column stack */
@media (max-width: 640px){
  .deposit-grid,
  .withdraw-grid{  grid-template-columns: 1fr; }
}
/* --- More space before Save/Cancel --- */
.card .actions{
  margin-top: 18px;              /* push buttons down from fields */
  padding-top: 14px;             /* visual separation */
  border-top: 1px dashed #e5e7eb;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Slightly more room between each input block as well */
.form-grid > label{ margin-bottom: 4px; }
.input{ min-height: 42px; }      /* consistent control height */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.logout-btn {
  margin-left: auto;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 6px;
  background: #e74c3c;
  color: #fff;
  border: none;
  text-decoration: none;
}

.logout-btn:hover {
  background: #c0392b;
  color: #fff;
}

/* Center login screen */
.wpcrmao-auth {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #f9f9fb;
}

.login-box {
  background: #fff;
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.login-box h1 {
  font-size: 22px;
  margin-bottom: 20px;
  font-weight: 600;
  color: #333;
}

.login-box label {
  display: block;
  text-align: left;
  font-size: 14px;
  margin-bottom: 6px;
  color: #555;
}

.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.login-box input[type="submit"] {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: #0073aa;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

.login-box input[type="submit"]:hover {
  background: #005f8d;
}
/* Add space between Amount and Actions in withdrawals table */
.tbl th.num,
.tbl td.num {
  padding-right: 40px;  /* adjust gap as needed */
}
.pagination {
  margin-top: 12px;
  text-align: center;
}
.pagination .page-link {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 3px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f9f9f9;
  text-decoration: none;
  color: #333;
}
.pagination .page-link.active {
  background: #0073aa;
  color: #fff;
  border-color: #0073aa;
}
.pagination .page-link:hover {
  background: #eee;
}
/* Tabs container */
.tabs{
  display:flex;
  gap:12px;
  width:100%;
  margin:12px 0 20px;
}

/* Base tab style */
.tab{
  flex:1 1 0;
  text-align:center;
  padding:12px 14px;
  border-radius:12px;
  font-weight:600;
  border:1px solid #e5e7eb;
  cursor:pointer;
  transition:background .15s ease, color .15s ease, box-shadow .15s ease;
}

/* Neutral hover */
.tab:hover{
  box-shadow:0 1px 2px rgba(0,0,0,.05);
}

/* Deposits → light green */
.tab[data-tab="deposits"]{
  background:#ecfdf5;      /* light green */
  color:#065f46;           /* dark green text */
}
.tab[data-tab="deposits"].active{
  background:#d1fae5;      /* stronger green */
  border-color:#10b981;
  color:#065f46;
}

/* Withdrawals → light red */
.tab[data-tab="withdrawals"]{
  background:#fef2f2;      /* light red */
  color:#991b1b;           /* dark red text */
}
.tab[data-tab="withdrawals"].active{
  background:#fee2e2;      /* stronger red */
  border-color:#ef4444;
  color:#991b1b;
}

/* Transaction History → neutral gray/blue */
.tab[data-tab="history"]{
  background:#f1f5f9;
  color:#334155;
}
.tab[data-tab="history"].active{
  background:#fff;
  border-color:#d1d5db;
  color:#111827;
}
/* Stat cards general */
.stat-card {
  background:#fff;
  border-radius:12px;
  padding:16px;
  box-shadow:0 1px 3px rgba(0,0,0,.05);
}

/* Specific color accents */
.stat-card .amount.red {
  color:#dc2626; /* withdrawals */
}
.stat-card .amount.blue {
  color:#2563eb; /* current balance */
}
.stat-card .amount.orange {
  color:#d97706; /* total bonus */
}

/* Owner share → green */
.stat-card.owner-share .amount {
  color:#059669; /* emerald green */
  font-weight:700;
}
/* Make the stats grid narrower and centered */
.stats-grid {
  max-width: 900px;
  margin: 0 auto 30px;   /* added 30px bottom margin */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.filter-bar {
  max-width: 600px;       /* make it narrower */
  margin: 0 auto 40px;    /* center horizontally + space below */
  text-align: center;     /* center contents */
}

.filter-bar .filter-grid {
  display: flex;
  justify-content: center;  /* center items inside */
  gap: 20px;                 /* spacing between inputs */
  flex-wrap: wrap;           /* wrap nicely on smaller screens */
}
.admin-expenses-btn { border-color: #6b7280; }
.admin-expenses-btn:hover { background: #f3f4f6; }
.dow-grid{
  display:grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  gap:10px;
	width:900px
}
.dow{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-decoration:none; border:1px solid #e5e7eb; border-radius:10px; padding:10px 6px;
  background:#fff; position:relative; box-shadow:0 1px 2px rgba(16,24,40,.05);
  transition:transform .06s ease, box-shadow .06s ease;
}
.dow:hover{ transform:translateY(-1px); box-shadow:0 2px 6px rgba(16,24,40,.08); }
.dow-top{
  position:absolute; top:0; left:0; right:0; height:10px; border-radius:10px 10px 0 0;
  background:#21a1f1;
}
.dow-label{ font-weight:700; font-size:14px; letter-spacing:.5px; color:#111827; margin-top:6px; }
.dow-sub{ font-size:12px; color:#6b7280; margin-top:2px; }
.dow.active{ border-color:#21a1f1; box-shadow:0 0 0 2px rgba(33,161,241,.25) inset; }