
    :root{--bg:#0b1020;--panel:#121a2f;--panel2:#17213b;--line:#263554;--text:#eaf0ff;--muted:#9fb0d1;--brand:#5b8cff;--brand2:#21d4a8;--danger:#ff5b79;--warn:#ffbe4d;--ok:#2ed47a;--shadow:0 18px 60px rgba(0,0,0,.35);--radius:18px}
    *{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:var(--text);background:radial-gradient(circle at top left,rgba(91,140,255,.22),transparent 35%),radial-gradient(circle at top right,rgba(33,212,168,.16),transparent 28%),var(--bg);min-height:100vh}
    button,input,select{font:inherit}button:disabled{opacity:.45;cursor:not-allowed}.hidden{display:none!important}
    .app{display:grid;grid-template-columns:292px 1fr;min-height:100vh}.sidebar{border-right:1px solid var(--line);background:rgba(12,18,34,.78);backdrop-filter:blur(14px);padding:22px 18px;position:sticky;top:0;height:100vh}
    .logo{display:flex;align-items:center;gap:12px;margin-bottom:22px;font-weight:850;font-size:18px}.logo-mark{width:42px;height:42px;border-radius:14px;background:linear-gradient(135deg,var(--brand),var(--brand2));display:grid;place-items:center;box-shadow:0 12px 30px rgba(91,140,255,.3);font-weight:950}
    .user-card,.card{background:rgba(18,26,47,.84);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.user-card{padding:14px;margin-bottom:18px}.card{padding:18px}.muted{color:var(--muted)}.small{font-size:12px}
    .nav{display:grid;gap:8px}.nav button{border:0;background:transparent;color:var(--muted);text-align:left;padding:12px 13px;border-radius:13px;cursor:pointer;display:flex;align-items:center;justify-content:space-between}.nav button:hover,.nav button.active{background:rgba(91,140,255,.14);color:var(--text)}
    .main{padding:24px;overflow:hidden}.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}h1{font-size:28px;margin:0 0 6px}h2{font-size:20px;margin:0}.actions{display:flex;gap:10px;flex-wrap:wrap}
    .btn{border:1px solid var(--line);background:var(--panel2);color:var(--text);border-radius:12px;padding:10px 14px;cursor:pointer}.btn.primary{background:linear-gradient(135deg,var(--brand),#7b61ff);border-color:transparent}.btn.ok{background:rgba(46,212,122,.14);border-color:rgba(46,212,122,.35)}.btn.danger{background:rgba(255,91,121,.12);border-color:rgba(255,91,121,.35)}
    .grid{display:grid;gap:16px}.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
    .metric{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.metric strong{font-size:26px;display:block;margin-top:8px}
    .pill{display:inline-flex;align-items:center;gap:7px;padding:5px 9px;border-radius:999px;font-size:12px;background:rgba(159,176,209,.12);color:var(--muted);border:1px solid rgba(159,176,209,.16);white-space:nowrap}.pill.ok{background:rgba(46,212,122,.12);color:#8ff0b8;border-color:rgba(46,212,122,.22)}.pill.warn{background:rgba(255,190,77,.12);color:#ffd58a;border-color:rgba(255,190,77,.22)}.pill.danger{background:rgba(255,91,121,.12);color:#ff9bad;border-color:rgba(255,91,121,.22)}.pill.blue{background:rgba(91,140,255,.13);color:#b9cbff;border-color:rgba(91,140,255,.24)}
    .section{display:none}.section.active{display:block}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:16px;background:rgba(0,0,0,.12)}table{border-collapse:collapse;width:100%;min-width:1160px}th,td{padding:11px 12px;border-bottom:1px solid rgba(38,53,84,.75);text-align:left;font-size:13px;vertical-align:middle}th{color:#c8d5f2;background:rgba(255,255,255,.04);position:sticky;top:0;z-index:1}tr:hover td{background:rgba(91,140,255,.05)}
    input,select{width:100%;background:#0e162b;color:var(--text);border:1px solid var(--line);border-radius:11px;padding:10px 11px;outline:none}label{display:grid;gap:7px;color:var(--muted);font-size:12px}.form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.form .wide{grid-column:span 2}
    .footer-note{margin-top:14px;color:var(--muted);font-size:12px}.toast{position:fixed;right:22px;bottom:22px;background:#15213b;border:1px solid var(--line);padding:13px 16px;border-radius:14px;box-shadow:var(--shadow);display:none}
    .login{min-height:100vh;display:grid;place-items:center;padding:22px}.login .card{width:min(460px,100%)}
    .team-card,.agency-toggle{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:15px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.035)}
    .month-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}.tab{border:1px solid var(--line);background:#0f1830;color:var(--muted);padding:9px 12px;border-radius:12px;cursor:pointer}.tab.active{background:rgba(91,140,255,.16);color:var(--text);border-color:rgba(91,140,255,.36)}
    .accordion{border:1px solid var(--line);border-radius:16px;overflow:hidden;margin-top:12px;background:rgba(0,0,0,.12)}.acc-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 14px;background:#17213b;cursor:pointer}.acc-body{display:none;padding:14px}.accordion.open>.acc-body{display:block}.indent{margin-left:18px}.summary-screen{display:grid;gap:14px}.summary-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.summary-card{border:1px solid var(--line);border-radius:18px;padding:16px;background:rgba(255,255,255,.035);cursor:pointer}.summary-card:hover{background:rgba(91,140,255,.08)}.crumbs{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:12px 0}.view-switch{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.view-switch button.active{background:rgba(91,140,255,.18);border-color:rgba(91,140,255,.38);color:var(--text)}.crumb{border:1px solid var(--line);background:#0f1830;color:var(--muted);padding:8px 10px;border-radius:999px;cursor:pointer}.crumb.active{color:var(--text);background:rgba(91,140,255,.16)}.clean-panel{border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.03);padding:16px;margin-top:14px}.split-title{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:12px}@media(max-width:1000px){.summary-cards{grid-template-columns:1fr}}
    .status-dot{width:9px;height:9px;border-radius:50%;display:inline-block;background:var(--ok)}.status-dot.pause{background:var(--warn)}.status-dot.off{background:var(--danger)}
    .row-ban td{background:rgba(255,91,121,.16)!important}.row-ad-issue td{background:rgba(255,190,77,.10)!important}
    .mode-switch{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.mode-switch .tab{margin:0}.manual-agency-block{border:1px solid var(--line);border-radius:16px;margin-top:12px;overflow:hidden;background:rgba(0,0,0,.12)}.manual-agency-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 14px;background:#17213b}.agency-badge{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:750}.ag-FAST{background:rgba(91,140,255,.20);color:#c8d6ff}.ag-TDZ{background:rgba(255,190,77,.18);color:#ffe0a3}.ag-VPA{background:rgba(33,212,168,.16);color:#a9f4df}.ag-IG{background:rgba(190,120,255,.17);color:#dfc3ff}.ag-MT{background:rgba(255,91,121,.16);color:#ffbdc9}.ag-LAVRA{background:rgba(159,176,209,.16);color:#d7e1f5}
    @media(max-width:1000px){.app{grid-template-columns:1fr}.sidebar{position:relative;height:auto}.cols-4,.cols-3,.cols-2,.form{grid-template-columns:1fr}.form .wide{grid-column:auto}.topbar{align-items:flex-start;flex-direction:column}}
  
.empty-day{opacity:.55}
.empty-day .acc-head{padding:8px 14px}
.empty-day .pill{font-size:11px}

.day-details-table table{min-width:980px}
.day-details-table{overflow-x:auto}
.day-details-table th,.day-details-table td{white-space:nowrap}

.member-modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.62);display:none;align-items:center;justify-content:center;z-index:9999}
.member-modal{width:min(560px,92vw);background:#101a31;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:18px}
.member-modal h3{margin:0 0 12px}
.member-modal-grid{display:grid;gap:10px}
.member-modal-grid label{display:grid;gap:6px;color:var(--muted);font-size:12px}
.member-modal-grid input,.member-modal-grid select{width:100%;background:#0b1326;border:1px solid var(--line);border-radius:12px;color:var(--text);padding:11px 12px;outline:none}
.member-modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:14px}


/* clean split login */
body {
  min-height: 100vh;
}

.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 420px;
  max-width: calc(100vw - 32px);
  padding: 28px;
}

.login-card .logo {
  margin-bottom: 22px;
}

.form.one {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.form.one input {
  width: 100%;
  box-sizing: border-box;
}

#loginError {
  margin-top: 14px;
  color: #ff8a8a;
}

/* split pages layout fix */
.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background:
    radial-gradient(circle at top right, rgba(42, 157, 143, .14), transparent 34%),
    #070b18;
}

.sidebar {
  width: auto;
  min-height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(8, 14, 31, .78);
  box-sizing: border-box;
}

.main {
  padding: 28px 28px 60px;
  min-width: 0;
}

.nav {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.nav button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.current-user-card {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }
}

.app-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 48px));
  z-index: 9999;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(116, 154, 255, .32);
  background: rgba(13, 22, 45, .96);
  box-shadow: 0 20px 60px rgba(0,0,0,.38);
  color: var(--text);
}

.app-toast.hidden {
  display: none;
}

.app-toast-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.app-toast-body {
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.45;
}

.btn.loading {
  opacity: .75;
  pointer-events: none;
}

.btn.loading::after {
  content: '...';
}

/* Stats visual colors */
.pill.stat-spend {
  background: rgba(255, 214, 102, .16);
  border-color: rgba(255, 214, 102, .45);
  color: #ffd666;
}

.pill.stat-leads {
  background: rgba(255, 176, 92, .15);
  border-color: rgba(255, 176, 92, .42);
  color: #ffb05c;
}

.pill.stat-deps {
  background: rgba(68, 210, 120, .17);
  border-color: rgba(68, 210, 120, .48);
  color: #44d278;
}

.pill.status-active {
  background: rgba(68, 210, 120, .14);
  border-color: rgba(68, 210, 120, .48);
  color: #44d278;
}

.pill.status-paused {
  background: rgba(255, 214, 102, .16);
  border-color: rgba(255, 214, 102, .45);
  color: #ffd666;
}

.pill.status-error {
  background: rgba(255, 87, 87, .15);
  border-color: rgba(255, 87, 87, .5);
  color: #ff5757;
}

.stats-row-agency-fast td {
  background: rgba(255, 214, 102, .045);
}

.stats-row-agency-mt td {
  background: rgba(80, 150, 255, .055);
}

.stats-row-agency-tdz td {
  background: rgba(178, 120, 255, .055);
}

.stats-row-agency-ig td {
  background: rgba(255, 120, 180, .05);
}

.stats-row-agency-vpa td {
  background: rgba(80, 220, 180, .05);
}

.stats-row-problem td {
  background: rgba(255, 87, 87, .12) !important;
  box-shadow: inset 3px 0 0 rgba(255, 87, 87, .85);
}

.stats-cell-paused {
  background: rgba(255, 214, 102, .20) !important;
  color: #ffd666;
  font-weight: 700;
}

.stats-cell-rejected {
  background: rgba(255, 87, 87, .20) !important;
  color: #ff7777;
  font-weight: 800;
}

.stats-cell-lead {
  background: rgba(143, 255, 178, .14) !important;
  color: #9dffbd;
  font-weight: 800;
}

.stats-cell-dep {
  background: rgba(68, 210, 120, .25) !important;
  color: #63ff9f;
  font-weight: 900;
}

.stats-cell-spend-problem {
  background: rgba(255, 87, 87, .24) !important;
  color: #ff7777;
  font-weight: 900;
}

/* Strong stats colors */
#buyerStatsDays .pill.stat-spend {
  background: rgba(255, 220, 80, .28) !important;
  border: 1px solid rgba(255, 220, 80, .75) !important;
  color: #ffe27a !important;
  font-weight: 800 !important;
}

#buyerStatsDays .pill.stat-leads {
  background: rgba(255, 155, 60, .24) !important;
  border: 1px solid rgba(255, 155, 60, .7) !important;
  color: #ffb36a !important;
  font-weight: 800 !important;
}

#buyerStatsDays .pill.stat-deps {
  background: rgba(55, 220, 120, .28) !important;
  border: 1px solid rgba(55, 220, 120, .75) !important;
  color: #63ff9f !important;
  font-weight: 900 !important;
}

#buyerStatsDays .pill.status-active {
  background: rgba(55, 220, 120, .18) !important;
  border: 1px solid rgba(55, 220, 120, .7) !important;
  color: #63ff9f !important;
  font-weight: 800 !important;
}

#buyerStatsDays .pill.status-paused {
  background: rgba(255, 220, 80, .25) !important;
  border: 1px solid rgba(255, 220, 80, .75) !important;
  color: #ffe27a !important;
  font-weight: 800 !important;
}

#buyerStatsDays .pill.status-error {
  background: rgba(255, 80, 80, .28) !important;
  border: 1px solid rgba(255, 80, 80, .85) !important;
  color: #ff8585 !important;
  font-weight: 900 !important;
}

#buyerStatsDays tr.stats-row-agency-fast > td {
  background-color: rgba(255, 220, 80, .08) !important;
}

#buyerStatsDays tr.stats-row-agency-mt > td {
  background-color: rgba(70, 150, 255, .10) !important;
}

#buyerStatsDays tr.stats-row-agency-tdz > td {
  background-color: rgba(180, 115, 255, .10) !important;
}

#buyerStatsDays tr.stats-row-agency-ig > td {
  background-color: rgba(255, 115, 180, .09) !important;
}

#buyerStatsDays tr.stats-row-agency-vpa > td {
  background-color: rgba(80, 220, 180, .09) !important;
}

#buyerStatsDays tr.stats-row-problem > td {
  background-color: rgba(255, 70, 70, .18) !important;
  box-shadow: inset 3px 0 0 rgba(255, 70, 70, .95) !important;
}

#buyerStatsDays td.stats-cell-paused {
  background-color: rgba(255, 220, 80, .28) !important;
  color: #ffe27a !important;
  font-weight: 800 !important;
}

#buyerStatsDays td.stats-cell-rejected {
  background-color: rgba(255, 70, 70, .28) !important;
  color: #ff8585 !important;
  font-weight: 900 !important;
}

#buyerStatsDays td.stats-cell-lead {
  background-color: rgba(120, 255, 160, .20) !important;
  color: #a2ffc0 !important;
  font-weight: 900 !important;
}

#buyerStatsDays td.stats-cell-dep {
  background-color: rgba(55, 220, 120, .34) !important;
  color: #63ff9f !important;
  font-weight: 900 !important;
}

#buyerStatsDays td.stats-cell-spend-problem {
  background-color: rgba(255, 70, 70, .32) !important;
  color: #ff8585 !important;
  font-weight: 900 !important;
}

/* Stats visual tune v2 */

/* collapsed day pills */
#buyerStatsDays .pill.stat-spend {
  background: rgba(255, 242, 145, .34) !important;
  border-color: rgba(255, 242, 145, .9) !important;
  color: #fff1a6 !important;
  text-shadow: 0 0 10px rgba(255, 230, 120, .22);
}

#buyerStatsDays .pill.stat-leads {
  background: rgba(255, 210, 150, .26) !important;
  border-color: rgba(255, 210, 150, .72) !important;
  color: #ffd9a3 !important;
  text-shadow: 0 0 10px rgba(255, 190, 110, .18);
}

#buyerStatsDays .pill.stat-deps {
  background: rgba(55, 220, 120, .28) !important;
  border-color: rgba(55, 220, 120, .75) !important;
  color: #63ff9f !important;
}

/* remove ugly red vertical stripes */
#buyerStatsDays tr.stats-row-problem > td {
  box-shadow: none !important;
  border-left: none !important;
}

/* agency blocks: stronger separation */
#buyerStatsDays tr.stats-row-agency-fast > td:first-child {
  border-left: 5px solid rgba(255, 242, 145, .95) !important;
}
#buyerStatsDays tr.stats-row-agency-mt > td:first-child {
  border-left: 5px solid rgba(70, 150, 255, .95) !important;
}
#buyerStatsDays tr.stats-row-agency-tdz > td:first-child {
  border-left: 5px solid rgba(180, 115, 255, .95) !important;
}
#buyerStatsDays tr.stats-row-agency-ig > td:first-child {
  border-left: 5px solid rgba(255, 115, 180, .95) !important;
}
#buyerStatsDays tr.stats-row-agency-vpa > td:first-child {
  border-left: 5px solid rgba(80, 220, 180, .95) !important;
}

#buyerStatsDays tr.stats-row-agency-fast > td {
  background-color: rgba(255, 242, 145, .105) !important;
}
#buyerStatsDays tr.stats-row-agency-mt > td {
  background-color: rgba(70, 150, 255, .125) !important;
}
#buyerStatsDays tr.stats-row-agency-tdz > td {
  background-color: rgba(180, 115, 255, .125) !important;
}
#buyerStatsDays tr.stats-row-agency-ig > td {
  background-color: rgba(255, 115, 180, .11) !important;
}
#buyerStatsDays tr.stats-row-agency-vpa > td {
  background-color: rgba(80, 220, 180, .11) !important;
}

/* problem row should be red, but cleaner */
#buyerStatsDays tr.stats-row-problem > td {
  background-color: rgba(255, 70, 70, .20) !important;
}

#buyerStatsDays tr.stats-row-problem td.stats-cell-spend-problem {
  background-color: rgba(255, 70, 70, .36) !important;
  color: #ff9a9a !important;
}

/* table readability */
#buyerStatsDays table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.055);
}

#buyerStatsDays table tbody tr:hover > td {
  filter: brightness(1.12);
}

/* Stats visual tune v3 */

/* collapsed metrics: colored background, white text */
#buyerStatsDays .pill.stat-spend,
#buyerStatsDays .pill.stat-leads,
#buyerStatsDays .pill.stat-deps {
  color: #ffffff !important;
  font-weight: 900 !important;
  text-shadow: none !important;
}

#buyerStatsDays .pill.stat-spend {
  background: rgba(255, 205, 65, .40) !important;
  border-color: rgba(255, 225, 110, .95) !important;
}

#buyerStatsDays .pill.stat-leads {
  background: rgba(255, 150, 65, .34) !important;
  border-color: rgba(255, 185, 110, .85) !important;
}

#buyerStatsDays .pill.stat-deps {
  background: rgba(40, 210, 115, .42) !important;
  border-color: rgba(75, 255, 150, .90) !important;
}

/* stronger agency color blocks */
#buyerStatsDays tr.stats-row-agency-fast > td {
  background-color: rgba(255, 219, 75, .18) !important;
}

#buyerStatsDays tr.stats-row-agency-mt > td {
  background-color: rgba(0, 180, 255, .20) !important;
}

#buyerStatsDays tr.stats-row-agency-tdz > td {
  background-color: rgba(190, 100, 255, .20) !important;
}

#buyerStatsDays tr.stats-row-agency-ig > td {
  background-color: rgba(255, 105, 180, .18) !important;
}

#buyerStatsDays tr.stats-row-agency-vpa > td {
  background-color: rgba(50, 230, 185, .18) !important;
}

/* clear agency side markers */
#buyerStatsDays tr.stats-row-agency-fast > td:first-child {
  border-left: 8px solid #ffd84d !important;
}

#buyerStatsDays tr.stats-row-agency-mt > td:first-child {
  border-left: 8px solid #00c8ff !important;
}

#buyerStatsDays tr.stats-row-agency-tdz > td:first-child {
  border-left: 8px solid #c46cff !important;
}

#buyerStatsDays tr.stats-row-agency-ig > td:first-child {
  border-left: 8px solid #ff6bb8 !important;
}

#buyerStatsDays tr.stats-row-agency-vpa > td:first-child {
  border-left: 8px solid #43e6bd !important;
}

/* keep problem row red over agency colors */
#buyerStatsDays tr.stats-row-problem > td {
  background-color: rgba(255, 65, 80, .26) !important;
}

#buyerStatsDays tr.stats-row-problem > td:first-child {
  border-left: 8px solid #ff4d5e !important;
}

/* Stats pills align/readability v4 */
#buyerStatsDays .acc-head > div:last-child {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 7px !important;
  flex-wrap: nowrap !important;
}

#buyerStatsDays .acc-head .pill {
  min-width: 72px !important;
  height: 24px !important;
  padding: 0 9px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-width: 1px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  font-weight: 650 !important;
  letter-spacing: -.02em !important;
  color: rgba(255,255,255,.94) !important;
  text-shadow: none !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

#buyerStatsDays .acc-head .pill.stat-spend {
  min-width: 104px !important;
  background: rgba(255, 205, 65, .30) !important;
  border-color: rgba(255, 225, 110, .55) !important;
}

#buyerStatsDays .acc-head .pill.stat-leads {
  min-width: 78px !important;
  background: rgba(255, 150, 65, .24) !important;
  border-color: rgba(255, 185, 110, .48) !important;
}

#buyerStatsDays .acc-head .pill.stat-deps {
  min-width: 78px !important;
  background: rgba(40, 210, 115, .30) !important;
  border-color: rgba(75, 255, 150, .55) !important;
}

/* CPL / CPD neutral but readable */
#buyerStatsDays .acc-head .pill:not(.stat-spend):not(.stat-leads):not(.stat-deps) {
  min-width: 76px !important;
  background: rgba(125, 145, 190, .18) !important;
  border-color: rgba(160, 180, 230, .22) !important;
  color: rgba(235,240,255,.82) !important;
  font-weight: 550 !important;
}

/* date title cleaner */
#buyerStatsDays .acc-head > b {
  font-size: 17px !important;
  font-weight: 750 !important;
  letter-spacing: -.03em !important;
}

/* Stats header metrics fixed columns */
#buyerStatsDays .acc-head {
  display: grid !important;
  grid-template-columns: 1fr 560px !important;
  align-items: center !important;
  gap: 14px !important;
}

#buyerStatsDays .acc-head > div:last-child {
  display: grid !important;
  grid-template-columns: 112px 78px 78px 78px 86px 86px !important;
  gap: 7px !important;
  justify-content: end !important;
}

#buyerStatsDays .acc-head .pill {
  width: 100% !important;
  min-width: 0 !important;
  height: 23px !important;
  padding: 0 7px !important;
  font-size: 11.5px !important;
  font-weight: 550 !important;
  color: rgba(255,255,255,.94) !important;
  border-width: 1px !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

#buyerStatsDays .acc-head .pill.stat-spend,
#buyerStatsDays .acc-head .pill.stat-leads,
#buyerStatsDays .acc-head .pill.stat-deps {
  font-weight: 650 !important;
}

#buyerStatsDays .acc-head .pill:not(.stat-spend):not(.stat-leads):not(.stat-deps) {
  color: rgba(240,244,255,.78) !important;
}

/* ===== Admin panel visual fix ===== */

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 22px 0;
}

.side-nav button,
.sidebar button[data-admin-nav] {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.side-nav button:hover,
.sidebar button[data-admin-nav]:hover {
  background: rgba(255,255,255,.06);
  color: var(--text);
}

.side-nav button.active,
.sidebar button[data-admin-nav].active {
  background: rgba(88, 119, 255, .20);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(120,150,255,.10);
}

.side-nav button span {
  color: var(--muted);
  font-weight: 700;
}

.stats-grid,
#adminDashboardCards {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.stat-card {
  background: rgba(20, 31, 58, .78);
  border: 1px solid rgba(120,150,255,.16);
  border-radius: 18px;
  padding: 20px;
  min-height: 88px;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
}

.stat-card b {
  display: block;
  font-size: 28px;
  line-height: 1.15;
  margin-top: 8px;
}

.admin-dashboard-teams {
  margin-top: 18px;
}

.admin-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.admin-team-card {
  background: rgba(20, 31, 58, .74);
  border: 1px solid rgba(120,150,255,.14);
  border-radius: 16px;
  padding: 16px;
}

@media (max-width: 1100px) {
  .stats-grid,
  #adminDashboardCards {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .admin-team-grid {
    grid-template-columns: 1fr;
  }
}

.btn[style*="--progress"] {
  position: relative;
  overflow: hidden;
}

.btn[style*="--progress"]::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  background: rgba(96, 165, 250, 0.35);
  pointer-events: none;
  transition: width .2s ease;
}

.btn[style*="--progress"] {
  isolation: isolate;
}

.btn[style*="--progress"]::after {
  content: "";
}


.btn-progress{
  position:relative;
  overflow:hidden;
}

.btn-progress::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:var(--progress,0%);
  background:rgba(59,130,246,.35);
  transition:width .2s linear;
  z-index:0;
}

.btn-progress{
  isolation:isolate;
}

.btn-progress{
  color:#fff;
}


.month-sync-progress{
  display:none;
  margin-top:10px;
  padding:10px 12px;
  border:1px solid rgba(148,163,184,.25);
  border-radius:12px;
  background:rgba(15,23,42,.55);
}

.month-sync-progress.show{
  display:block;
}

.month-sync-progress-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
  font-size:13px;
  color:#cbd5e1;
}

.month-sync-progress-track{
  height:10px;
  border-radius:999px;
  background:rgba(148,163,184,.18);
  overflow:hidden;
}

.month-sync-progress-bar{
  height:100%;
  width:0%;
  border-radius:999px;
  background:linear-gradient(90deg,#3b82f6,#8b5cf6);
  transition:width .2s linear;
}


#monthSyncProgressBox.show{
  display:block !important;
  width:100%;
}

#monthSyncProgressBox{
  margin:12px 0 14px 0;
}


/* Meta accounts missing from manual agency blocks */
.meta-missing-box .table-wrap {
  max-height: 320px;
  overflow-y: auto;
}

.meta-missing-box table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Creo payout selector */
#creoPayoutSelect {
  min-width: 110px;
}

.creo-controls,
.split-title .actions:has(#creoPayoutSelect) {
  align-items: end;
  gap: 10px;
}

.split-title label:has(#creoPayoutSelect) {
  min-width: 120px;
  font-size: 12px;
  color: var(--muted);
}

.split-title label:has(#creoPayoutSelect) select {
  margin-top: 6px;
}

/* Creo payout select visual fix */
.creo-payout-label {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  min-width: 180px !important;
  max-width: 220px;
}

.creo-payout-label select,
#creoPayoutSelect {
  width: 100% !important;
  min-width: 180px !important;
  height: 42px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
}

/* Creo controls layout fix */
#section-creo .split-title {
  align-items: flex-end;
}

#section-creo .split-title .actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
}

.creo-month-label,
.creo-payout-label {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin: 0 !important;
}

.creo-month-label {
  width: 220px !important;
  min-width: 220px !important;
}

.creo-payout-label {
  width: 160px !important;
  min-width: 160px !important;
}

#creoMonthSelect,
#creoPayoutSelect {
  width: 100% !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
}

/* Agency topups visual block */
.balance-badge {
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 850;
  font-size: 12px;
  background: rgba(148,163,184,.14);
}

.balance-badge.ok,
.balance-text.ok {
  color: #22c55e;
}

.balance-badge.warn,
.balance-text.warn {
  color: #f59e0b;
}

.balance-badge.danger,
.balance-text.danger {
  color: #ef4444;
}

.balance-badge.blue,
.balance-text.blue {
  color: #38bdf8;
}

.agency-topups-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(15,23,42,.52);
}

.agency-topups-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric.mini {
  padding: 12px;
}

.metric.mini span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.metric.mini strong {
  font-size: 16px;
}

.agency-topups-table {
  max-height: 260px;
  overflow-y: auto;
}

@media (max-width: 1100px) {
  .agency-topups-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Agency topups mode: hide agency settings form */
.buyer-agency-card.topups-open .agency-settings-form {
  display: none !important;
}

.agency-topups-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.topup-comment-input {
  width: 100%;
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(15,23,42,.55);
  color: var(--text);
  padding: 8px 10px;
}

.agency-topups-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Admin summary topups compact block */
.clean-panel .agency-topups-grid.compact {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.clean-panel .agency-topups-grid.compact .metric.mini {
  min-height: 0;
  padding: 12px 14px;
  display: block;
}

.clean-panel .agency-topups-grid.compact .metric.mini span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.2;
}

.clean-panel .agency-topups-grid.compact .metric.mini strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.clean-panel .agency-topups-table {
  margin-top: 12px;
}

.clean-panel .agency-topups-table table th,
.clean-panel .agency-topups-table table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.meta-action-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  font-weight: 700;
}
.meta-action-link:hover {
  opacity: .75;
}

button.meta-action-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-style: dotted;
}
button.meta-action-link:hover {
  opacity: .75;
}

.meta-action-clickable {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  font-weight: 700;
}
.meta-action-clickable:hover {
  opacity: .75;
}

.meta-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}
.meta-actions-grid > div {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,.03);
}
.meta-actions-grid span {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}
.meta-action-clickable {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  font-weight: 700;
}
.meta-action-clickable:hover {
  opacity: .75;
}

.meta-actions-status-big {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

.meta-row-just-updated {
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: -2px;
}

/* Compact sync bar */

#syncInfoCard{
  padding:10px 14px !important;
  margin-bottom:12px !important;
}

#syncInfoCard .grid{
  display:flex !important;
  align-items:center;
  gap:28px;
}

#syncInfoCard .metric{
  min-height:auto !important;
  padding:0 !important;
  background:none !important;
  border:none !important;
}

#syncInfoCard .metric .muted{
  display:none !important;
}

#syncInfoCard .metric strong{
  font-size:14px !important;
  line-height:1.2 !important;
}

#syncStatusText{
  font-size:15px !important;
  font-weight:700 !important;
}

#lastSyncTime,
#nextSyncTime{
  font-size:14px !important;
  font-weight:600 !important;
}

#syncInfoCard .pill.blue{
  display:none !important;
}

#syncInfoCard .metric:nth-child(2)::before{
  content:"Последнее: ";
  color:var(--muted);
  margin-right:4px;
}

#syncInfoCard .metric:nth-child(3)::before{
  content:"Следующее: ";
  color:var(--muted);
  margin-right:4px;
}



.team-card-title,
.team-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-logo-img,
.team-logo-fallback {
  flex: 0 0 auto;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(120,150,255,.2);
  background: rgba(255,255,255,.06);
}

.team-logo-fallback {
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg,var(--brand),var(--brand2));
  box-shadow: 0 12px 30px rgba(91,140,255,.22);
}

.small-btn {
  padding: 7px 10px;
  font-size: 12px;
}


.current-user-card {
  padding: 12px 12px;
}

.current-user-card .muted.small {
  font-size: 11px;
  letter-spacing: .01em;
}

.current-user-card #userName {
  display: block;
  max-width: 220px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  color: rgba(255,255,255,.88);
}

.current-user-card #userRole {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 850;
  padding: 8px 11px;
}


.team-logo-edit {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex: 0 0 auto;
}

.team-logo-pencil {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  background: rgba(91, 140, 255, .95);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  opacity: .9;
}

.team-logo-edit:hover .team-logo-pencil {
  transform: scale(1.06);
  opacity: 1;
}


.logo-mark.has-team-logo {
  overflow: hidden;
  background: rgba(255,255,255,.06);
}

.logo-mark.has-team-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
