:root {
  --ink: #132238;
  --muted: #6f7d90;
  --soft: #98a4b4;
  --line: #e8edf2;
  --surface: #ffffff;
  --canvas: #f5f7f9;
  --navy: #0b1424;
  --green: #20a873;
  --green-dark: #14815a;
  --green-soft: #e8f7f1;
  --amber: #eaa834;
  --blue: #4f7cf3;
  --violet: #8f6de8;
  --shadow: 0 15px 45px rgba(21, 35, 55, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.auth-pending { display: none !important; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0,#e9f8f2 0,transparent 38%),var(--canvas); }
.login-card { width: min(430px,100%); background: white; border: 1px solid var(--line); border-radius: 22px; padding: 34px; box-shadow: var(--shadow); }
.login-brand { color: var(--ink); margin-bottom: 32px; }
.login-card h1 { font: 800 31px "Manrope",sans-serif; margin: 5px 0 8px; }
.login-card > p:not(.section-kicker) { color: var(--muted); line-height: 1.6; margin: 0 0 24px; }
.login-card form, .password-panel form, #resetPasswordForm { display: grid; gap: 14px; }
.login-card label, .password-panel label, .user-form-grid label, #resetPasswordForm label { display: grid; gap: 7px; color: var(--ink); font-size: 9px; font-weight: 700; }
.login-card input, .password-panel input, .user-form-grid input, .user-form-grid select, #resetPasswordForm input { width: 100%; height: 42px; border: 1px solid #dfe5ea; border-radius: 10px; padding: 0 12px; outline: 0; background: #fbfcfd; color: var(--ink); }
.login-card input:focus, .password-panel input:focus, .user-form-grid input:focus, .user-form-grid select:focus, #resetPasswordForm input:focus { border-color: #70cbae; box-shadow: 0 0 0 3px rgba(32,168,115,.1); background: white; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 57px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; border-radius: 7px; background: #edf2f0; color: var(--green-dark); padding: 6px 8px; font-size: 8px; font-weight: 700; cursor: pointer; }
.form-error { min-height: 14px; margin: 0; color: #b45149; font-size: 9px; line-height: 1.45; }
.form-message { min-height: 0; margin: 0; color: var(--green-dark); font-size: 9px; line-height: 1.45; }
.form-message:empty { display: none; }
button, textarea { font: inherit; }
button { color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; }
.sidebar {
  background: var(--navy);
  color: #f7fbff;
  width: 248px;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 26px 18px 18px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 11px;
  font: 800 23px/1 "Manrope", sans-serif;
  letter-spacing: -.6px;
  padding: 0 10px 30px;
}
.brand-mark { width: 34px; height: 34px; border-radius: 10px; color: #0b1424; background: #64d6ac; display: grid; place-items: center; transform: rotate(-3deg); }
.brand-mark svg { width: 25px; height: 25px; stroke-width: 2.1; }
.nav-list { display: grid; gap: 7px; }
.nav-item {
  border: 0;
  background: transparent;
  color: #99a6b8;
  padding: 12px 13px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s ease;
  text-align: left;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: rgba(100, 214, 172, .14); }
.nav-item.active svg { color: #64d6ac; }
.nav-item svg { width: 19px; height: 19px; }
.admin-pill { margin-left: auto; color: #7f8b9d; background: rgba(255,255,255,.07); font-size: 9px; text-transform: uppercase; letter-spacing: .7px; padding: 3px 6px; border-radius: 5px; }
.sidebar-bottom { margin-top: auto; }
.team-streak { margin: 16px 6px; padding: 14px 12px; background: linear-gradient(135deg, rgba(100,214,172,.15), rgba(100,214,172,.05)); border: 1px solid rgba(100,214,172,.14); border-radius: 13px; display: flex; gap: 10px; align-items: center; }
.streak-icon { color: #64d6ac; font-size: 19px; }
.team-streak strong, .team-streak span { display: block; }
.team-streak strong { font-size: 12px; }
.team-streak span { color: #8996a8; font-size: 10px; margin-top: 2px; }
.profile-mini { width: 100%; border: 0; border-top: 1px solid rgba(255,255,255,.08); background: transparent; display: flex; gap: 10px; align-items: center; color: white; padding: 18px 8px 4px; cursor: pointer; text-align: left; }
.profile-mini:hover .profile-copy strong { color: #64d6ac; }
.logout-button { width: 100%; margin-top: 11px; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; background: rgba(255,255,255,.04); color: #b7c1cd; padding: 8px; font-size: 9px; cursor: pointer; }
.logout-button:hover { color: white; background: rgba(255,255,255,.08); }
.profile-mini > svg { color: #657286; width: 17px; margin-left: auto; }
.avatar { width: 37px; height: 37px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: 0 0 auto; background: linear-gradient(145deg, #557a8f, #29485b); }
.avatar-emilio { background: linear-gradient(145deg, #e18c6e, #925049); }
.avatar-adrian { background: linear-gradient(145deg, #658ddc, #374e90); }
.avatar-william { background: linear-gradient(145deg, #9b73cf, #5f3e8c); }
.avatar-claudolph { background: linear-gradient(145deg, #5ba592, #2c6d62); }
.avatar-khai { background: linear-gradient(145deg, #d69e56, #976421); }
.profile-copy { min-width: 0; }
.profile-copy strong, .profile-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.profile-copy strong { font-size: 12px; transition: .2s; }
.profile-copy small { color: #7e8b9d; font-size: 10px; margin-top: 3px; }

.main-content { margin-left: 248px; min-height: 100vh; }
.topbar { height: 72px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 10; padding: 0 clamp(22px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between; }
.breadcrumb { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--soft); }
.breadcrumb b { color: #d4dae2; font-weight: 400; }
.breadcrumb strong { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 10px; position: relative; }
.mode-switch { height: 39px; padding: 3px; display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); background: #eef1f3; border-radius: 10px; }
.mode-switch > span { color: var(--soft); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 0 6px; }
.mode-switch button { height: 31px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); padding: 0 9px; font-size: 9px; font-weight: 700; cursor: pointer; transition: .2s; }
.mode-switch button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 8px rgba(20,33,52,.09); }
.source-switch { height: 39px; padding: 3px; display: flex; align-items: center; gap: 2px; border: 1px solid #dceee7; background: #f1f8f5; border-radius: 10px; }
.source-switch > span { color: var(--green-dark); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .55px; padding: 0 6px; }
.source-switch button { height: 31px; border: 0; border-radius: 7px; background: transparent; color: #658174; padding: 0 8px; font-size: 8px; font-weight: 700; cursor: pointer; }
.source-switch button.active { color: var(--green-dark); background: #fff; box-shadow: 0 2px 8px rgba(20,80,55,.09); }
.icon-button { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: grid; place-items: center; cursor: pointer; position: relative; transition: .2s; }
.icon-button:hover { border-color: #ccd5df; box-shadow: 0 5px 15px rgba(20,34,54,.06); }
.icon-button svg { width: 18px; height: 18px; }
.notification-dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #ef6c65; border: 2px solid white; box-sizing: content-box; top: 7px; right: 7px; }
.period-select { height: 39px; padding: 0 12px; display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.period-select > svg { width: 16px; height: 16px; color: var(--muted); }
.period-select .chevron { width: 13px; margin-left: 4px; }
.period-menu { position: absolute; right: 0; top: 48px; width: 210px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 11px; padding: 5px; display: none; }
.period-menu.open { display: grid; }
.period-menu button { border: 0; background: transparent; text-align: left; padding: 9px 10px; border-radius: 7px; color: var(--muted); font-size: 12px; cursor: pointer; }
.period-menu button:hover, .period-menu button.selected { background: var(--green-soft); color: var(--green-dark); }
.custom-range { border-top: 1px solid var(--line); margin-top: 4px; padding: 9px 7px 5px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.custom-range[hidden] { display: none; }
.custom-range label { color: var(--soft); font-size: 8px; font-weight: 700; }
.custom-range input { width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 5px; color: var(--ink); font-size: 9px; }
.custom-range .apply-range { grid-column: 1 / -1; background: var(--green); color: white; text-align: center; font-weight: 700; }
.mobile-menu { display: none; border: 0; background: transparent; padding: 4px; }

.view { display: none; padding: 48px clamp(24px, 4.2vw, 62px) 70px; max-width: 1530px; margin: auto; animation: riseIn .35s ease; }
.view.active { display: block; }
@keyframes riseIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 32px; }
.page-heading h1 { font: 800 clamp(29px, 3vw, 38px)/1.2 "Manrope", sans-serif; letter-spacing: -1.4px; margin: 6px 0 7px; color: #101e31; }
.page-heading h1 span { color: var(--green-dark); }
.page-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow, .section-kicker { color: var(--green-dark); text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; margin: 0; }
.goal-status { border: 1px solid #dceee7; background: #f4fbf8; color: #3e725f; border-radius: 999px; padding: 9px 13px; font-size: 11px; font-weight: 600; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.goal-status span { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 3px rgba(32,168,115,.13); }
.goal-status b { font-weight: 600; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 16px; margin-bottom: 17px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 18px; box-shadow: 0 8px 30px rgba(21,35,55,.025); transition: transform .2s, box-shadow .2s; overflow: hidden; position: relative; }
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-top { display: flex; justify-content: space-between; align-items: center; }
.metric-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.metric-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.metric-icon svg { width: 16px; height: 16px; }
.metric-icon.green { background: var(--green-soft); color: var(--green-dark); }
.metric-icon.blue { background: #edf2ff; color: var(--blue); }
.metric-icon.amber { background: #fff5e4; color: #cb8514; }
.metric-icon.violet { background: #f3effc; color: var(--violet); }
.metric-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 14px; }
.metric-value strong { font: 800 25px/1 "Manrope", sans-serif; letter-spacing: -.8px; }
.change { color: var(--green-dark); background: var(--green-soft); font-size: 9px; font-weight: 700; padding: 3px 5px; border-radius: 5px; }
.change.neutral { color: #7e8693; background: #f1f3f5; }
.metric-sub { margin: 8px 0 0; color: var(--soft); font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(285px, .8fr); gap: 17px; }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(21,35,55,.025); }
.progress-panel { padding: 23px 25px 25px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 23px; }
.panel-heading h2, .rank-top h2 { font: 700 18px/1.3 "Manrope", sans-serif; letter-spacing: -.35px; margin: 4px 0 0; }
.updated-label { font-size: 9px; color: var(--soft); }
.goal-list { display: grid; gap: 21px; }
.goal-row-top { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; margin-bottom: 8px; }
.goal-name { display: flex; gap: 9px; align-items: center; font-size: 12px; font-weight: 600; }
.goal-dot { width: 7px; height: 7px; border-radius: 50%; }
.goal-values { color: var(--soft); font-size: 10px; }
.goal-values strong { color: var(--ink); font-size: 11px; }
.progress-track { height: 7px; border-radius: 99px; background: #edf1f3; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; transition: width .8s cubic-bezier(.2,.8,.2,1); position: relative; }
.progress-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.32)); }

.rank-card { background: linear-gradient(150deg, #101d30, #0b1525); color: #fff; padding: 23px 24px 19px; position: relative; overflow: hidden; border-color: #172740; }
.rank-glow { position: absolute; border-radius: 50%; width: 170px; height: 170px; background: rgba(73, 202, 154, .13); filter: blur(2px); right: -72px; top: -78px; }
.rank-top { display: flex; align-items: flex-start; justify-content: space-between; position: relative; }
.rank-top .section-kicker { color: #64d6ac; }
.rank-badge { font-size: 9px; color: #73e0b8; border: 1px solid rgba(100,214,172,.23); background: rgba(100,214,172,.09); border-radius: 99px; padding: 5px 8px; }
.rank-number { display: flex; align-items: baseline; gap: 4px; margin: 19px 0 17px; }
.rank-number small { font: 700 24px "Manrope"; color: #64d6ac; }
.rank-number strong { font: 800 58px/.8 "Manrope"; letter-spacing: -3px; }
.rank-number span { margin-left: 7px; color: #718096; font-size: 11px; }
.rank-number span b { color: #adb8c8; }
.rank-divider { height: 1px; background: rgba(255,255,255,.08); }
.rank-neighbors { margin: 14px 0 12px; display: grid; gap: 7px; }
.rank-person { display: flex; align-items: center; gap: 8px; font-size: 10px; color: #9aa7b8; }
.rank-person.you { color: #fff; }
.rank-person .mini-rank { width: 13px; color: #647388; }
.rank-person .avatar { width: 23px; height: 23px; font-size: 7px; }
.rank-person b { margin-left: auto; color: #fff; font-size: 9px; }
.text-button { border: 0; padding: 5px 0; background: transparent; color: #70dbb3; font-size: 10px; font-weight: 600; cursor: pointer; }
.text-button span { display: inline-block; margin-left: 4px; transition: transform .2s; }
.text-button:hover span { transform: translateX(3px); }

.activity-panel { margin-top: 17px; padding: 22px 25px 12px; }
.ghost-button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; color: var(--muted); font-size: 10px; font-weight: 600; cursor: pointer; }
.ghost-button:hover { color: var(--green-dark); border-color: #bfe1d4; }
.activity-list { display: grid; }
.activity-item { padding: 12px 0; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-top: 1px solid #f0f3f5; }
.activity-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; }
.activity-icon.deal { background: #fff4df; }
.activity-icon.goal { background: var(--green-soft); }
.activity-icon.rank { background: #f2edfc; }
.activity-copy strong, .activity-copy small { display: block; }
.activity-copy strong { font-size: 11px; }
.activity-copy small { color: var(--soft); font-size: 9px; margin-top: 3px; }
.activity-points { font-size: 9px; font-weight: 700; color: var(--green-dark); background: var(--green-soft); padding: 5px 7px; border-radius: 6px; }

.leaderboard-heading { align-items: center; }
.segmented-control { padding: 4px; display: flex; background: #e9edf0; border-radius: 11px; }
.segmented-control button { border: 0; background: transparent; padding: 8px 13px; border-radius: 8px; color: var(--muted); font-size: 10px; font-weight: 600; cursor: pointer; }
.segmented-control button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(20,33,52,.08); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 54px auto 18px; max-width: 790px; align-items: end; }
.podium-card { border: 1px solid var(--line); background: #fff; border-radius: 18px; min-height: 162px; padding: 20px; text-align: center; position: relative; }
.podium-card.first { min-height: 187px; padding-top: 25px; border-color: #d9e9e3; box-shadow: 0 15px 40px rgba(32,168,115,.09); }
.podium-rank { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 800 11px "Manrope"; background: #eff2f4; color: #7b8794; border: 3px solid var(--canvas); }
.podium-card.first .podium-rank { background: var(--green); color: #fff; }
.podium-card .avatar { margin: auto; width: 47px; height: 47px; font-size: 12px; }
.podium-card strong { display: block; font-size: 12px; margin-top: 10px; }
.podium-card small { display: block; color: var(--soft); font-size: 9px; margin-top: 3px; }
.podium-score { margin-top: 10px; font: 800 17px "Manrope"; color: var(--green-dark); }
.podium-score span { font: 500 8px "DM Sans"; color: var(--soft); }
.leaderboard-table-panel { overflow: hidden; }
.table-header-row, .leaderboard-row { display: grid; grid-template-columns: 60px minmax(190px, 1.6fr) repeat(3, minmax(100px, .75fr)); align-items: center; gap: 12px; padding: 0 22px; }
.table-header-row { min-height: 42px; color: var(--soft); background: #fafbfc; text-transform: uppercase; font-size: 8px; letter-spacing: .7px; font-weight: 700; border-bottom: 1px solid var(--line); }
.leaderboard-row { min-height: 62px; border-bottom: 1px solid #f0f2f4; font-size: 11px; color: #586679; }
.leaderboard-row:last-child { border-bottom: 0; }
.leaderboard-row.current { background: #f3faf7; }
.rank-cell { font: 700 12px "Manrope"; color: var(--soft); }
.leaderboard-person { display: flex; gap: 10px; align-items: center; }
.leaderboard-person .avatar { width: 34px; height: 34px; font-size: 9px; }
.leaderboard-person strong, .leaderboard-person small { display: block; }
.leaderboard-person strong { color: var(--ink); font-size: 11px; }
.leaderboard-person small { color: var(--soft); font-size: 8px; margin-top: 2px; }
.leaderboard-value { font-weight: 600; }
.score-cell { color: var(--green-dark); font-weight: 700; }

.updates-heading { margin-bottom: 27px; }
.cft-panel { padding: 25px 27px; margin-bottom: 17px; border-color: #d8ebe4; }
.cft-simulator-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(285px,.8fr); gap: 22px; }
.integration-console-grid select { width: 100%; height: 42px; margin-bottom: 14px; border: 1px solid #dfe5ea; border-radius: 10px; padding: 0 12px; background: #fbfcfd; color: var(--ink); }
.integration-console-grid code { font-size: .92em; }
.integration-help .detected-deal + .detected-deal { margin-top: 10px; }
.cft-preview { border-left: 1px solid var(--line); padding-left: 22px; min-width: 0; }
.cft-preview .empty-preview { min-height: 220px; }
.helper-copy { color: var(--soft); font-size: 9px; line-height: 1.5; margin: 8px 0 14px; }
.update-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, .75fr); gap: 17px; }
.sentence-card { padding: 28px; position: relative; overflow: hidden; }
.sentence-icon { position: absolute; right: -20px; top: -27px; width: 115px; height: 115px; border-radius: 50%; background: #f1faf6; color: #b1dfce; display: grid; place-items: center; }
.sentence-icon svg { width: 43px; height: 43px; }
.input-heading { position: relative; }
.beta-pill { color: var(--green-dark); background: var(--green-soft); border-radius: 99px; padding: 5px 8px; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-right: 74px; }
form label { display: block; font-size: 10px; font-weight: 700; margin-bottom: 7px; }
.sentence-input-wrap { position: relative; }
textarea { resize: vertical; min-height: 112px; width: 100%; border: 1px solid #dfe5ea; background: #fbfcfd; border-radius: 12px; padding: 14px 15px 28px; outline: 0; color: var(--ink); font-size: 13px; line-height: 1.6; transition: .2s; }
textarea:focus { background: white; border-color: #70cbae; box-shadow: 0 0 0 3px rgba(32,168,115,.1); }
textarea::placeholder { color: #a2acb8; }
.char-count { position: absolute; bottom: 9px; right: 11px; color: var(--soft); font-size: 8px; }
.examples { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 10px 0 18px; }
.examples span { color: var(--soft); font-size: 9px; }
.examples button { border: 1px solid var(--line); border-radius: 99px; background: #fff; padding: 5px 8px; color: var(--muted); font-size: 8px; cursor: pointer; max-width: 255px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.examples button:hover { border-color: #bfe1d4; color: var(--green-dark); }
.primary-button { border: 0; background: var(--green); color: #fff; box-shadow: 0 8px 18px rgba(32,168,115,.19); border-radius: 10px; padding: 10px 15px; display: flex; gap: 8px; align-items: center; font-size: 11px; font-weight: 700; cursor: pointer; transition: .2s; }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button svg { width: 15px; height: 15px; }
.parser-preview { padding: 25px; }
.empty-preview { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--soft); }
.empty-preview strong { color: var(--ink); font-size: 11px; margin-top: 15px; }
.empty-preview p { max-width: 210px; font-size: 9px; line-height: 1.55; margin: 6px 0; }
.scan-lines { width: 64px; height: 55px; border: 1px dashed #cfd8df; border-radius: 10px; padding: 13px 11px; display: grid; gap: 6px; }
.scan-lines i { height: 4px; background: #e8edef; border-radius: 4px; }
.scan-lines i:nth-child(2) { width: 70%; }
.detected-data { display: grid; gap: 9px; }
.detected-deal { display: grid; gap: 7px; border: 1px solid #dfe8e4; border-radius: 12px; padding: 11px; background: #fcfefd; }
.detected-deal.has-warning { border-color: #ecd8af; background: #fffdf8; }
.detected-deal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 3px; }
.detected-deal-head strong { font-size: 10px; }
.detected-deal-head span { font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--green-dark); background: var(--green-soft); border-radius: 99px; padding: 4px 6px; }
.detected-deal.has-warning .detected-deal-head span { color: #9a6713; background: #fff2d9; }
.detected-row { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.detected-row span { color: var(--soft); font-size: 9px; text-transform: capitalize; }
.detected-row strong { font-size: 11px; text-align: right; }
.detected-confidence { margin-top: 8px; color: var(--green-dark); background: var(--green-soft); border-radius: 8px; padding: 9px 11px; font-size: 9px; display: flex; align-items: center; gap: 7px; }
.detected-confidence i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.detected-confidence.warning { color: #92600e; background: #fff2d9; }
.detected-confidence.warning i { background: #dc991e; }
.history-panel { margin-top: 17px; padding: 23px 25px 12px; }
.history-list { display: grid; }
.history-item { border-top: 1px solid #f0f2f4; padding: 13px 0; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 12px; align-items: center; }
.history-bubble { width: 31px; height: 31px; background: #f0f4f6; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.history-bubble svg { width: 14px; height: 14px; }
.history-bubble .avatar { width: 31px; height: 31px; border-radius: 9px; font-size: 8px; }
.history-copy strong, .history-copy small { display: block; }
.history-copy strong { font-size: 10px; }
.history-copy small { font-size: 8px; color: var(--soft); margin-top: 3px; }
.history-time { font-size: 8px; color: var(--soft); text-align: right; }
.week-chip { display: inline-flex; align-items: center; color: var(--green-dark); background: var(--green-soft); border-radius: 99px; padding: 3px 6px; margin-left: 5px; font-size: 7px; font-weight: 700; }
.file-label { color: var(--muted); font-size: 8px; font-weight: 600; margin-left: 5px; }
.history-actions { display: flex; align-items: center; gap: 10px; }
.history-actions > small { color: var(--soft); font-size: 8px; white-space: nowrap; }
.delete-deal-button, .delete-cft-button { border: 1px solid #efd5d2; background: #fffafa; color: #b45149; border-radius: 7px; padding: 6px 8px; font-size: 8px; font-weight: 700; cursor: pointer; transition: .2s; }
.delete-deal-button:hover, .delete-cft-button:hover { color: #fff; background: #c65f56; border-color: #c65f56; }
.history-bubble.source-cft { color: var(--green-dark); background: var(--green-soft); font-size: 9px; font-weight: 800; }
.history-bubble.integration-error { color: #a33a35; background: #fff0ef; font-weight: 800; }
.source-label { color: var(--green-dark); }
.source-label.debt-manager { color: #58718f; }

.import-panel { margin-bottom: 17px; padding: 24px 26px; }
.import-panel .panel-heading { margin-bottom: 16px; }
.import-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(250px,.65fr); gap: 14px; align-items: stretch; }
.import-drop { min-height: 92px; border: 1px dashed #b9d7cb; background: #f7fcfa; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; transition: .2s; }
.import-drop:hover { border-color: var(--green); background: #f0faf6; }
.import-drop svg { width: 20px; height: 20px; color: var(--green-dark); margin-bottom: 7px; }
.import-drop strong { font-size: 11px; }
.import-drop span { color: var(--soft); font-size: 8px; margin-top: 4px; }
.import-summary { min-height: 92px; border: 1px solid #dceae4; background: #fbfefd; border-radius: 12px; padding: 18px; display: flex; flex-direction: column; justify-content: center; }
.import-summary[hidden] { display: none; }
.import-summary strong { font: 700 15px "Manrope", sans-serif; }
.import-summary span { color: var(--muted); font-size: 9px; margin-top: 7px; line-height: 1.5; }

.client-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.client-controls select { height: 38px; border: 1px solid var(--line); background: white; border-radius: 9px; padding: 0 28px 0 10px; color: var(--muted); font-size: 10px; font-weight: 600; }
.client-search { height: 38px; min-width: 210px; margin: 0; border: 1px solid var(--line); background: white; border-radius: 9px; padding: 0 10px; display: flex; align-items: center; gap: 7px; }
.client-search svg { width: 14px; height: 14px; color: var(--soft); flex: 0 0 auto; }
.client-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 10px; }
.client-search input::placeholder { color: var(--soft); }
.clients-table-panel { overflow: hidden; }
.clients-header-row, .client-row { display: grid; grid-template-columns: minmax(150px,1.35fr) minmax(85px,.7fr) minmax(100px,.8fr) minmax(100px,.8fr) minmax(70px,.55fr) minmax(130px,1fr); gap: 12px; align-items: center; padding: 0 22px; }
.clients-header-row { min-height: 42px; color: var(--soft); background: #fafbfc; text-transform: uppercase; font-size: 8px; letter-spacing: .7px; font-weight: 700; border-bottom: 1px solid var(--line); }
.client-row { min-height: 60px; color: #586679; font-size: 10px; border-bottom: 1px solid #f0f2f4; }
.client-row:last-child { border-bottom: 0; }
.client-name strong, .client-name small { display: block; }
.client-name strong { color: var(--ink); font-size: 11px; }
.client-name small { color: var(--soft); font-size: 8px; margin-top: 3px; }
.client-payments strong, .client-payments small { display: block; }
.client-payments small { color: var(--violet); font-size: 7px; font-weight: 700; margin-top: 3px; }
.client-status { display: flex; flex-wrap: wrap; gap: 4px; }
.status-pill { display: inline-flex; border-radius: 99px; padding: 5px 7px; background: #eef2f4; color: var(--muted); font-size: 8px; font-style: normal; font-weight: 700; }
.status-pill.active, .status-pill.locked { background: var(--green-soft); color: var(--green-dark); }
.status-pill.canceled { background: #fff0ef; color: #b45149; }
.status-pill.pending-cancellation, .status-pill.welcome-call-missing { background: #fff3df; color: #9a6713; }

.employee-modal { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 20px; }
.employee-modal.open { display: grid; }
.modal-backdrop { border: 0; background: rgba(5,12,21,.55); backdrop-filter: blur(4px); position: absolute; inset: 0; cursor: default; }
.modal-card { width: min(480px, 100%); max-height: min(650px, 90vh); overflow: auto; background: white; border-radius: 19px; padding: 25px; box-shadow: 0 30px 80px rgba(5,12,21,.25); position: relative; animation: modalIn .25s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(.97) translateY(7px); } to { opacity: 1; transform: none; } }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.modal-heading h2 { font: 700 20px "Manrope"; margin: 4px 0 20px; }
.modal-close { border: 0; background: #f5f7f8; }
.modal-copy { color: var(--muted); font-size: 10px; line-height: 1.6; margin: -7px 0 18px; }
.employee-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.employee-option { border: 1px solid var(--line); border-radius: 12px; padding: 11px; background: #fff; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.employee-option:hover, .employee-option.active { border-color: #8ed2ba; background: #f4fbf8; }
.employee-option .avatar { width: 35px; height: 35px; font-size: 9px; }
.employee-option strong, .employee-option small { display: block; }
.employee-option strong { font-size: 10px; }
.employee-option small { color: var(--soft); font-size: 8px; margin-top: 2px; }

.users-table-panel { overflow: hidden; }
.users-header-row, .user-row { display: grid; grid-template-columns: minmax(175px,1.2fr) minmax(190px,1.2fr) minmax(135px,.9fr) minmax(95px,.65fr) minmax(165px,1fr) minmax(230px,1.4fr); gap: 15px; align-items: center; padding: 0 20px; }
.users-header-row { min-height: 42px; border-bottom: 1px solid var(--line); color: var(--soft); background: #fafbfc; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .55px; }
.user-row { min-height: 72px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.user-row:last-child { border-bottom: 0; }
.user-row.inactive { background: #fafafa; opacity: .72; }
.user-name { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.user-name .avatar { width: 34px; height: 34px; font-size: 9px; }
.user-name strong, .user-name small, .credential-status { display: block; }
.user-name small, .credential-status { color: var(--soft); font-size: 8px; margin-top: 3px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.user-actions button { border: 1px solid var(--line); border-radius: 7px; background: white; padding: 6px 7px; color: var(--muted); font-size: 8px; font-weight: 700; cursor: pointer; }
.user-actions button:hover { border-color: #9fd5c2; color: var(--green-dark); }
.user-modal-card { width: min(690px,100%); }
.user-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.account-layout { display: grid; grid-template-columns: minmax(0,.8fr) minmax(330px,1.2fr); gap: 17px; }
.account-summary, .password-panel { padding: 25px; }
.account-summary h2 { font: 700 22px "Manrope",sans-serif; margin: 7px 0 22px; }
.account-summary dl { margin: 0; display: grid; gap: 13px; }
.account-summary dl div { border-top: 1px solid var(--line); padding-top: 12px; }
.account-summary dt { color: var(--soft); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.account-summary dd { margin: 5px 0 0; color: var(--ink); font-size: 11px; }
.password-panel form { max-width: 480px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; min-width: 270px; border: 1px solid #cce7dc; border-radius: 13px; background: white; box-shadow: 0 18px 50px rgba(20,40,31,.16); padding: 13px 15px; display: flex; align-items: center; gap: 11px; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { transform: none; opacity: 1; }
.toast.warning { border-color: #ead6ab; }
.toast.warning .toast-check { background: #fff2d9; color: #9a6713; }
.toast-check { width: 27px; height: 27px; background: var(--green-soft); color: var(--green-dark); border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.toast strong, .toast small { display: block; }
.toast strong { font-size: 10px; }
.toast small { color: var(--soft); font-size: 8px; margin-top: 3px; }

.rep-mode .admin-only, .rep-mode .rep-hide { display: none !important; }
.rep-mode .topbar { height: 64px; }
.rep-mode .view { padding-top: 26px; padding-bottom: 34px; }
.rep-mode #leaderboardView .page-heading { margin-bottom: 10px; }
.rep-mode #leaderboardView .page-heading > div > p:last-child { display: none; }
.rep-mode #leaderboardView .page-heading h1 { font-size: 32px; margin-bottom: 0; }
.rep-mode .podium { margin-top: 31px; margin-bottom: 12px; }
.rep-mode .podium-card { min-height: 128px; padding: 17px 15px 13px; }
.rep-mode .podium-card.first { min-height: 145px; padding-top: 20px; }
.rep-mode .podium-card .avatar { width: 40px; height: 40px; }
.rep-mode .podium-card strong { margin-top: 7px; }
.rep-mode .podium-score { margin-top: 7px; font-size: 15px; }
.rep-mode .table-header-row { min-height: 36px; }
.rep-mode .leaderboard-row { min-height: 51px; }
.viewing-admin .consultant-only-panel { display: none !important; }
.role-consultant .role-admin-only { display: none !important; }
.role-consultant .profile-mini { cursor: default; }
.role-consultant .profile-mini > svg { display: none; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .rank-card { min-height: 300px; }
  .rank-neighbors { max-width: 430px; }
  .update-layout { grid-template-columns: 1fr; }
  .cft-simulator-grid { grid-template-columns: 1fr; }
  .cft-preview { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
  .parser-preview { min-height: 280px; }
  .import-body { grid-template-columns: 1fr; }
  .clients-table-panel { overflow-x: auto; }
  .clients-header-row, .client-row { min-width: 850px; }
  .users-table-panel { overflow-x: auto; }
  .users-header-row, .user-row { min-width: 1080px; }
  .account-layout { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 20px 0 50px rgba(5,12,21,.22); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .mobile-menu { display: grid; place-items: center; cursor: pointer; }
  .breadcrumb { display: none; }
  .topbar { padding: 0 18px; }
  .view { padding: 34px 18px 55px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .segmented-control { width: 100%; overflow-x: auto; }
  .segmented-control button { flex: 1; }
  .podium { gap: 7px; margin-top: 45px; }
  .podium-card { padding: 17px 8px; }
  .table-header-row, .leaderboard-row { grid-template-columns: 42px minmax(145px,1fr) minmax(90px,.65fr); padding: 0 14px; gap: 8px; }
  .table-header-row span:nth-child(3), .leaderboard-row > span:nth-child(3) { display: none; }
  .table-header-row span:nth-child(5), .leaderboard-row > span:nth-child(5) { display: none; }
  .employee-options { grid-template-columns: 1fr; }
  .user-form-grid { grid-template-columns: 1fr; }
  .history-item { grid-template-columns: 31px minmax(0,1fr); align-items: start; }
  .history-actions { grid-column: 2; justify-content: flex-start; }
  .client-controls { width: 100%; }
  .client-controls select { flex: 1; min-width: 0; }
  .client-search { flex: 1 1 100%; min-width: 100%; }
}
@media (max-width: 540px) {
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { padding: 15px; }
  .metric-value strong { font-size: 20px; }
  .metric-icon { width: 28px; height: 28px; }
  .goal-status { display: none; }
  .progress-panel, .activity-panel, .sentence-card, .parser-preview, .history-panel { padding: 19px; }
  .podium-card { min-height: 145px; }
  .podium-card.first { min-height: 170px; }
  .podium-card .avatar { width: 39px; height: 39px; }
  .podium-card small { display: none; }
  .beta-pill { display: none; }
  .period-select { padding: 0 9px; }
  .period-select > svg:first-child { display: none; }
  .mode-switch > span { display: none; }
  .mode-switch button { padding: 0 7px; }
  .top-actions > .icon-button { display: none; }
  .source-switch > span { display: none; }
  .source-switch button { padding: 0 6px; font-size: 7px; }
}
