:root{font-family:Inter,"Segoe UI",Arial,sans-serif;color:#17231f;background:#f4f7f5;font-synthesis:none}
*{box-sizing:border-box}
body{margin:0;min-height:100vh}
a{color:#08775a}
.shell{width:min(1120px,calc(100% - 32px));margin:32px auto}
.login-card{max-width:560px}
.brand{display:flex;align-items:center;gap:10px;color:#0b3b2d;font-weight:800;font-size:18px;text-decoration:none}
.brand-mark{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#0d7959;color:white}
.card{margin-top:22px;padding:26px;border:1px solid #e1e9e4;border-radius:16px;background:white;box-shadow:0 12px 32px #18382a0b}
h1{margin:0;color:#113e30;font-size:26px}
.subtitle{margin:7px 0 22px;color:#68776f}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
label{display:grid;gap:6px;color:#40534a;font-size:13px;font-weight:650}
input{width:100%;min-height:44px;padding:10px 12px;border:1px solid #d5dfd9;border-radius:8px;font:inherit}
input:focus{outline:3px solid #08775a20;border-color:#08775a}
.wide{grid-column:1/-1}
button,.button{display:inline-flex;align-items:center;justify-content:center;min-height:43px;padding:0 16px;border:0;border-radius:8px;background:#0a7757;color:white;font:inherit;font-weight:700;text-decoration:none;cursor:pointer}
button:disabled{opacity:.6;cursor:wait}
.secondary{border:1px solid #d5dfd9;background:#fff;color:#2d4438}
.message{min-height:20px;margin:14px 0 0;color:#42564b;font-size:13px}
.message.error{color:#b42318}
.success-panel{margin-top:18px;padding:16px;border:1px solid #9ed5b5;border-radius:10px;background:#effaf2}
.success-panel code{display:block;overflow-wrap:anywhere;margin:8px 0;color:#145333;font-weight:700}
.toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin:20px 0}
.toolbar-actions{display:flex;align-items:center;gap:8px}
.profile-menu{position:relative}
.profile-menu summary{display:flex;align-items:center;justify-content:center;min-height:43px;padding:0 16px;border:1px solid #d5dfd9;border-radius:8px;background:#fff;color:#2d4438;font-size:13px;font-weight:700;cursor:pointer;list-style:none}
.profile-menu summary::-webkit-details-marker{display:none}
.profile-menu summary::after{content:"";width:7px;height:7px;margin:0 0 4px 10px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg)}
.profile-menu[open] summary::after{margin-bottom:0;transform:rotate(225deg)}
.profile-menu-panel{position:absolute;top:calc(100% + 8px);right:0;z-index:5;display:none;width:min(320px,calc(100vw - 40px));padding:16px;border:1px solid #d5dfd9;border-radius:12px;background:#fff;box-shadow:0 12px 32px #18382a1a}
.profile-menu[open] .profile-menu-panel{display:grid;gap:10px}
.profile-details{margin:0;color:#40534a;font-size:13px;overflow-wrap:anywhere}
.password-form{display:grid;gap:10px;padding-top:10px;border-top:1px solid #e8eee9}
.password-form[hidden]{display:none}
.password-form-actions{display:flex;flex-wrap:wrap;gap:8px}
.share-panel,.reward-section{margin:22px 0}
.share-panel h2,.reward-section h2{margin-bottom:6px;color:#113e30;font-size:18px}
.share-panel p,.reward-section p{margin:6px 0 12px;color:#68776f;font-size:13px}
.share-panel>strong{display:block;margin:10px 0;color:#0c6249;font-size:18px}
.share-link{display:grid;grid-template-columns:1fr auto;align-items:end;gap:8px}
.share-link label{grid-column:1/-1}
.share-link input{min-width:0}
.reward-table{min-width:620px}
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.stat{padding:14px;border:1px solid #e2eae5;border-radius:10px;background:#fbfdfb}
.stat small{display:block;color:#697970}
.stat strong{display:block;margin-top:5px;color:#0c6249;font-size:18px}
.table-wrap{overflow:auto;border:1px solid #e3eae6;border-radius:10px}
table{width:100%;border-collapse:collapse;min-width:930px}
th,td{padding:12px 10px;border-bottom:1px solid #e8eee9;text-align:left;white-space:nowrap;font-size:12px}
th{background:#f7faf8;color:#5a6c61;font-size:11px;text-transform:uppercase;letter-spacing:.04em}
tbody tr:last-child td{border-bottom:0}
.pill{display:inline-block;padding:4px 8px;border-radius:99px;background:#fff2d7;color:#815b00;font-size:10px;font-weight:800}
.pill.on-trial{background:#fff2d7;color:#815b00}
.pill.converted{background:#e8f0ff;color:#315b9b}
.pill.paid{background:#e5f7ed;color:#197246}
.pill.dormant{background:#fce8e7;color:#a33b35}
.muted{color:#78877e}
@media(max-width:650px){.shell{width:min(100% - 20px,1120px);margin:18px auto}.card{padding:18px}.form-grid,.stats{grid-template-columns:1fr}h1{font-size:22px}.wide{grid-column:auto}.toolbar-actions{margin-left:auto}.share-link{grid-template-columns:1fr}.share-link label{grid-column:auto}}
.agent-dashboard.shell{width:min(1400px,calc(100% - 24px));margin:10px auto}
.agent-dashboard .card{margin-top:12px;padding:14px}
.agent-dashboard .toolbar{margin:0 0 8px;gap:8px}
.agent-dashboard h1{font-size:21px}
.agent-dashboard .subtitle{margin:3px 0 0;font-size:12px}
.agent-dashboard .message{min-height:0;margin:4px 0}
.dashboard-summary{display:grid;grid-template-columns:minmax(230px,.8fr) minmax(0,1.4fr);grid-template-areas:"share rewards" "commission commission";gap:8px;margin:8px 0 12px}
.dashboard-summary .share-panel,.dashboard-summary .reward-section{margin:0;padding:10px;border:1px solid #e3eae6;border-radius:8px;background:#fbfdfb}
.dashboard-summary .share-panel{grid-area:share}
.dashboard-summary .reward-section{grid-area:rewards}
.dashboard-summary #agentCommission{grid-area:commission;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.dashboard-summary .stat{padding:8px}
.dashboard-summary .stat strong{margin-top:2px;font-size:16px}
.dashboard-summary .share-panel h2,.dashboard-summary .reward-section h2{margin:0;color:#113e30;font-size:15px}
.dashboard-summary .share-panel p,.dashboard-summary .reward-section p{margin:4px 0 7px;font-size:11px;line-height:1.35}
.dashboard-summary .share-panel>strong{margin:4px 0;font-size:15px}
.dashboard-summary .share-link{gap:5px}
.dashboard-summary .share-link label{font-size:11px}
.dashboard-summary input,.dashboard-summary button{min-height:34px;padding-top:6px;padding-bottom:6px;font-size:11px}
.dashboard-summary .reward-table{min-width:0}
.dashboard-summary .reward-table th,.dashboard-summary .reward-table td{padding:5px 6px;font-size:11px}
.dashboard-summary .reward-table th{font-size:10px}
.agent-dashboard .section-title{margin:8px 0 5px;color:#113e30;font-size:17px}
.agent-dashboard .referrals-table{width:100%;min-width:0;table-layout:fixed}
.agent-dashboard .referrals-table th,.agent-dashboard .referrals-table td{padding:6px;white-space:normal;overflow-wrap:anywhere;vertical-align:top;font-size:11px}
.agent-dashboard .referrals-table th{font-size:9px;letter-spacing:.02em}
.agent-dashboard .referrals-table th:nth-child(1){width:14%}
.agent-dashboard .referrals-table th:nth-child(2){width:7%}
.agent-dashboard .referrals-table th:nth-child(3){width:11%}
.agent-dashboard .referrals-table th:nth-child(4){width:13%}
.agent-dashboard .referrals-table th:nth-child(5){width:10%}
.agent-dashboard .referrals-table th:nth-child(6){width:8%}
.agent-dashboard .referrals-table th:nth-child(7){width:7%}
.agent-dashboard .referrals-table th:nth-child(8),.agent-dashboard .referrals-table th:nth-child(9){width:15%}
.agent-dashboard .referrals-table .pill{padding:3px 4px;font-size:9px;white-space:nowrap}
.payout-cell strong,.payout-cell small{display:block}
.payout-cell strong{font-size:10px;white-space:nowrap}
.payout-cell small{margin-top:2px;color:#5a6c61;font-size:9px;line-height:1.2}
.statement-section{margin-top:10px}
.statement-toolbar{display:flex;flex-wrap:wrap;align-items:end;justify-content:space-between;gap:8px;margin-bottom:6px}
.statement-toolbar h2{margin:0;color:#113e30;font-size:17px}
.period-filter{display:flex;flex-wrap:wrap;align-items:end;gap:6px}
.period-filter label{gap:3px;font-size:10px}
.period-filter input,.period-filter button{min-height:32px;padding:5px 8px;font-size:11px}
.statement-details>summary{margin:5px 0;color:#08775a;font-size:12px;font-weight:700;cursor:pointer}
.statement-table{min-width:1000px}
.statement-table th,.statement-table td{padding:6px;font-size:10px}
.statement-table th{font-size:9px}
.statement-details>button{min-height:32px;margin-top:6px;font-size:11px}
.rejection-reason{display:block;max-width:180px;margin-top:3px;color:#a33b35;font-size:10px;white-space:normal}
.pill.rejected{background:#fce8e7;color:#a33b35}
@media(max-width:850px){.dashboard-summary{grid-template-columns:1fr;grid-template-areas:"share" "rewards" "commission"}.dashboard-summary #agentCommission{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){.agent-dashboard.shell{width:calc(100% - 16px);margin:8px auto}.agent-dashboard .card{padding:10px}.agent-dashboard .referrals-table{min-width:760px}.dashboard-summary .share-link{grid-template-columns:1fr}.dashboard-summary .share-link label{grid-column:auto}}
@media(max-width:520px){.dashboard-summary #agentCommission{grid-template-columns:repeat(2,minmax(0,1fr))}.statement-toolbar{align-items:flex-start}.period-filter{width:100%}.period-filter label{flex:1;min-width:120px}.period-filter button{flex:1}}
