:root{--crm-green:#064e43;--crm-green-2:#0a5f51;--crm-orange:#e58b3a;--crm-cream:#fff5ed;--crm-bg:#f5f6f3;--crm-ink:#173d35;--crm-muted:#6d7c75;--crm-line:#dfe5df}
body{background:var(--crm-bg)}
body.portal-loading>*{visibility:hidden}
.portal{max-width:1250px;margin:auto;padding:55px 5% 80px}
.portal-heading{max-width:850px}
.portal h1{font-size:clamp(38px,4.5vw,60px);margin:20px 0;line-height:1.08}
.portal-heading>p{color:#63756a}
.panel{background:#fff;border:1px solid var(--crm-line);border-radius:16px;padding:30px;margin:25px 0}
.panel.narrow{max-width:600px}
.panel h2{font-size:32px}
.panel-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:0 0 28px}
.panel-heading h2{font:clamp(2rem,3vw,2.65rem)/1.08 Georgia,serif;margin:10px 0 6px}
.panel-heading p{margin:0;color:var(--crm-muted);font-size:.93rem}
label{display:block;font-size:14px;margin:15px 0}
input,select,textarea{display:block;width:100%;border:1px solid #cdd8ce;padding:13px;border-radius:9px;margin-top:6px;background:#fff;color:var(--crm-ink)}
textarea{min-height:100px;resize:vertical}
.consent{display:flex;gap:10px;align-items:flex-start;line-height:1.5}.consent input{width:auto;margin:5px 0}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}
.fine{font-size:13px;color:#68776d;line-height:1.7}
.error{background:#ffe3df!important;color:#8b2c20!important}
.text-button{text-decoration:underline;margin:20px 0 0;padding:0;font-size:14px}
.detail-actions,.manage-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.portal .notice{font-size:14px!important}
.status{display:inline-flex;align-items:center;gap:6px;font-size:12px;border-radius:999px;padding:6px 10px;background:#fff0d9;color:#835f1d;white-space:nowrap}
.status:before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.status.approved,.status.active,.status.paid{background:#e3f0e3;color:#22583a}
.status.suspended,.status.rejected,.status.failed{background:#fce7e1;color:#922d21}
dialog{max-width:820px;width:min(820px,calc(100% - 30px));max-height:90vh;overflow:auto}

/* Premium authentication experience */
body:not(.crm-ready){
  min-height:100vh;
  background:
    radial-gradient(circle at 9% 13%,#e58b3a26 0,transparent 26%),
    radial-gradient(circle at 91% 82%,#064e4324 0,transparent 30%),
    linear-gradient(145deg,#fffaf5 0%,#fff4e9 48%,#f3eee5 100%);
}
body:not(.crm-ready)::before,body:not(.crm-ready)::after{content:"";position:fixed;z-index:-1;border-radius:50%;pointer-events:none}
body:not(.crm-ready)::before{width:320px;height:320px;left:-150px;bottom:-120px;border:1px solid #064e4326;box-shadow:0 0 0 42px #064e4308,0 0 0 84px #064e4306}
body:not(.crm-ready)::after{width:230px;height:230px;right:-95px;top:75px;border:1px solid #e58b3a2b;box-shadow:0 0 0 36px #e58b3a08}
body:not(.crm-ready)>.portal-auth-header,.auth-portal>.portal-heading{display:none}
.auth-portal{position:relative;isolation:isolate;max-width:none;min-height:calc(100vh - 54px);margin:0;padding:42px 20px;display:grid;place-items:center}
.auth-portal>#message,.auth-portal>#signup-message,.auth-portal>#mode,.auth-portal>#chosen-plan{position:absolute;z-index:5;top:18px;left:50%;width:min(520px,calc(100% - 32px));transform:translateX(-50%);margin:0;box-shadow:0 10px 30px #083f3420}
.auth-card{width:min(100%,520px);margin:0;padding:38px 44px 34px;border:1px solid #ffffffcc;border-radius:28px;background:linear-gradient(150deg,#fffffffa,#fffdf9f2);box-shadow:0 30px 80px #153f3524,0 2px 8px #153f3512;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
.auth-card[hidden]{display:none!important}
.auth-logo{display:grid;place-items:center;width:246px;height:150px;margin:0 auto 30px;padding:12px 18px;overflow:hidden;border:1px solid #ead8c8;border-radius:18px;background:linear-gradient(145deg,#fffaf5,#f8eee5);box-shadow:0 12px 30px #4e342112}
.auth-logo img{display:block;width:100%;height:100%;object-fit:contain;object-position:center}
.auth-kicker{margin:0 0 10px;color:var(--crm-orange);font-size:.7rem;font-weight:850;letter-spacing:.2em;text-align:center}
.auth-card h1,.auth-card h2{margin:0;color:var(--crm-green);font:clamp(2rem,4.5vw,2.65rem)/1.05 Georgia,serif;letter-spacing:-.025em;text-align:center}
.auth-card h2{font-size:2rem}
.auth-intro,.auth-card>p{max-width:440px;margin:14px auto 26px;color:var(--crm-muted);font-size:.92rem;line-height:1.65;text-align:center}
.auth-card form{margin-top:25px}
.auth-card label{margin:16px 0 0;color:var(--crm-ink);font-size:.78rem;font-weight:750;letter-spacing:.015em}
.auth-card input{height:50px;margin-top:8px;padding:0 15px;border:1px solid #ccd8d0;border-radius:11px;background:#fffdfa;font-size:.94rem;transition:border-color .2s,box-shadow .2s,background .2s}
.auth-card input::placeholder{color:#98a49e}
.auth-card input:focus{outline:0;border-color:var(--crm-orange);background:#fff;box-shadow:0 0 0 4px #e58b3a1c}
.auth-primary{display:flex;align-items:center;justify-content:center;width:100%;min-height:52px;margin-top:24px;border-radius:11px;font-size:.9rem;font-weight:800;box-shadow:0 12px 25px #064e4326}
.auth-forgot{display:block;margin:17px auto 0;color:var(--crm-green);font-weight:700;text-decoration:none}
.auth-forgot:hover{text-decoration:underline;text-underline-offset:4px}
.auth-secondary{display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;margin-top:13px;border-color:#b9c9c1;border-radius:11px;color:var(--crm-green);font-size:.84rem;font-weight:800;text-decoration:none}
.auth-divider{display:flex;align-items:center;gap:13px;margin:25px 0 14px;color:#8b9791;font-size:.69rem;font-weight:750;letter-spacing:.1em;text-transform:uppercase}
.auth-divider::before,.auth-divider::after{content:"";height:1px;flex:1;background:#e0e7e2}
.auth-note{margin:0 auto 19px!important;font-size:.74rem!important;line-height:1.5!important}
.auth-back{display:block;width:max-content;max-width:100%;margin:22px auto 0;color:var(--crm-green);font-size:.78rem;font-weight:750;text-align:center;text-decoration:none}
.auth-back::before{content:"←";margin-right:7px;color:var(--crm-orange)}
.auth-back:hover{text-decoration:underline;text-underline-offset:4px}
body:not(.crm-ready)>footer{display:flex;justify-content:center;min-height:54px;padding:16px 20px;background:transparent;color:#6e7d76;font-size:.72rem;text-align:center}
.signup-page .auth-card{width:min(100%,720px)}
.signup-page .consent{margin-top:18px;color:var(--crm-muted);font-size:.75rem;font-weight:500}
.signup-page .consent input{height:auto;flex:0 0 auto;margin-top:3px;accent-color:var(--crm-green)}

/* CRM shell */
html:has(body.crm-ready),body.crm-ready{width:100%;max-width:none!important;margin:0!important;overflow-x:hidden}
body.crm-ready>.portal-auth-header,body.crm-ready>footer,body.crm-ready .portal>.portal-heading,body.crm-ready #mode,body.crm-ready #chosen-plan{display:none!important}
body.crm-ready .portal,body.crm-ready .auth-portal{display:block!important;width:100vw!important;max-width:none!important;min-height:100vh;margin:0!important;padding:0!important}
body.crm-ready #workspace{width:100%;max-width:none;margin:0}
body.crm-ready #message{position:fixed;right:28px;top:22px;z-index:120;max-width:420px;box-shadow:0 15px 45px #0b443522}
.crm-app{display:grid;grid-template-columns:252px minmax(0,1fr);width:100%;max-width:none;min-height:100vh;margin:0;background:var(--crm-bg)}
.crm-sidebar{position:sticky;top:0;height:100vh;background:var(--crm-green);color:#fff;display:flex;flex-direction:column;padding:20px 14px;z-index:30}
.crm-brand{display:flex;flex-direction:column;align-items:stretch;border-bottom:1px solid #ffffff24;padding:0 4px 18px;margin-bottom:18px}
.crm-logo-frame{display:grid;place-items:center;background:#fff;border-radius:10px;padding:5px 8px;margin:0 0 12px!important;box-shadow:0 7px 22px #002b2630}
.crm-brand .crm-logo-frame img{width:100%;height:78px;object-fit:contain;filter:none}
.crm-brand>span:last-child{font-size:.68rem;letter-spacing:.2em;font-weight:800;color:#f4b066;margin:0;text-align:center}
.crm-nav{display:flex;flex-direction:column;gap:5px;margin:0;padding:0}
.crm-nav button{display:flex;align-items:center;gap:11px;width:100%;margin:0;padding:12px 11px;border-radius:8px;color:#e9f2ef;text-align:left;font-size:.9rem;font-weight:650;transition:.18s ease}
.crm-nav button span{display:grid;place-items:center;width:22px;font-size:1.1rem}
.crm-nav button:hover{background:#ffffff12}
.crm-nav button.active{background:var(--crm-cream);color:var(--crm-green);box-shadow:0 5px 16px #002b2520}
.crm-sidebar-footer{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;margin-top:auto;padding:19px 8px 2px;border-top:1px solid #ffffff24}
.crm-avatar{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:var(--crm-orange);color:var(--crm-green);font-weight:850}
.crm-sidebar-footer strong,.crm-sidebar-footer small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-sidebar-footer strong{font-size:.78rem}.crm-sidebar-footer small{font-size:.66rem;color:#b9ccc6;margin-top:3px}
.crm-logout{font-size:1.25rem;color:#d7e5e1;padding:7px}
.crm-content{min-width:0;padding:30px 38px 64px}
.crm-topbar{display:flex;align-items:flex-end;justify-content:space-between;gap:30px;padding:5px 0 30px;border-bottom:1px solid var(--crm-line);margin-bottom:30px}
.crm-topbar h1{font:clamp(2rem,3.2vw,3.15rem)/1.05 Georgia,serif;letter-spacing:-.035em;margin:10px 0 0}
.crm-top-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.crm-search{display:flex;align-items:center;gap:7px;min-width:210px;margin:0;padding:0 11px;border:1px solid var(--crm-line);border-radius:9px;background:#fff}
.crm-search span{font-size:1.2rem;color:var(--crm-muted)}
.crm-search input{border:0;padding:10px 0;margin:0;outline:0;background:transparent}
.crm-view{animation:crm-in .2s ease}
.crm-view[hidden]{display:none!important}
@keyframes crm-in{from{opacity:.4;transform:translateY(5px)}to{opacity:1;transform:none}}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:0 0 24px}
.metric-card{min-height:170px;padding:23px;border:1px solid var(--crm-line);border-radius:15px;background:#fff;display:flex;flex-direction:column}
.metric-card small{color:var(--crm-muted);font-size:.76rem}.metric-card strong{font:2.7rem/1 Georgia,serif;margin:22px 0 11px}.metric-card span{margin-top:auto;color:#9b6729;font-size:.78rem;font-weight:700}
.crm-skeleton{position:relative;overflow:hidden;color:transparent}.crm-skeleton::after{content:"";position:absolute;inset:0;background:linear-gradient(105deg,transparent 20%,#f5eadf 45%,transparent 70%);animation:crm-shimmer 1.1s infinite;transform:translateX(-100%)}
@keyframes crm-shimmer{to{transform:translateX(100%)}}
.crm-overview-grid{display:grid;grid-template-columns:minmax(0,1.9fr) minmax(300px,.9fr);gap:22px}
.crm-overview-grid .panel{margin:0;min-height:325px}
.crm-health h2,.crm-next h2{font-size:2rem}
.health-row{display:grid;grid-template-columns:auto 1fr auto;gap:13px;align-items:center;padding:16px 3px;border-bottom:1px solid var(--crm-line)}
.health-row:last-child{border-bottom:0}.health-icon{display:grid;place-items:center;width:24px;height:24px;border:1.5px solid #4f9b68;color:#398455;border-radius:50%;font-size:.75rem;font-weight:900}
.health-row strong{font-size:.9rem}.health-row small{display:block;color:var(--crm-muted);margin-top:3px}.health-row b{font:1.1rem Georgia,serif}
.crm-next{background:var(--crm-green);color:#fff;border-color:var(--crm-green)}
.crm-next .eyebrow{color:#f0a55d}.crm-next p{color:#c7d6d1}.crm-next .button{margin-top:25px;background:var(--crm-orange);color:var(--crm-green)}
.crm-toolbar{display:flex;align-items:center;gap:15px;padding:15px 18px;background:#edf2ee;border-radius:12px;margin-bottom:15px}
.crm-toolbar label{margin:0;display:flex;align-items:center;gap:10px}.crm-toolbar select{width:auto;min-width:190px;margin:0;padding:9px 35px 9px 12px}
.crm-table{background:#fff;border:1px solid var(--crm-line);border-radius:14px;overflow:hidden}
.crm-table-head,.crm-table-row{display:grid;grid-template-columns:minmax(220px,1.4fr) minmax(135px,.7fr) minmax(120px,.6fr) minmax(260px,1fr);gap:18px;align-items:center;padding:15px 18px}
.crm-table-head{background:#f0f3f0;color:var(--crm-muted);font-size:.72rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.crm-table-row{border-top:1px solid var(--crm-line);min-height:92px}
.crm-table-row:first-of-type{border-top:0}.crm-table-row h3{font:1.2rem Georgia,serif;margin:0 0 5px}.crm-table-row p{font-size:.78rem;color:var(--crm-muted);margin:2px 0;line-height:1.4}
.crm-table-row .manage-actions{justify-content:flex-end}.crm-table-row .manage-actions button{font-size:.74rem;padding:8px 10px}
.crm-card-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.crm-card-list .manage-card,.manage-card{display:flex;justify-content:space-between;gap:20px;padding:20px;border:1px solid var(--crm-line);border-radius:13px;background:#fff;margin:0 0 12px}
.manage-card h3{font:1.3rem Georgia,serif;margin:8px 0}.manage-card p{font-size:.82rem;color:var(--crm-muted);margin:5px 0}
#finance-content>section,#billing-content>section,#profile-content>section,#engagement-content>div>section{background:#fff;border:1px solid var(--crm-line);border-radius:14px;padding:24px;margin:18px 0}
#ads-list{margin-top:24px}#ads-list>section{background:#fff;border:1px solid var(--crm-line);border-radius:14px;padding:24px;margin:18px 0}
#finance-content h3,#billing-content h3,#profile-content h3,#engagement-content h3{font:1.55rem Georgia,serif;margin:26px 0 10px}
.payment-card{border:1px solid var(--crm-line);border-radius:15px;padding:22px;background:linear-gradient(135deg,#0a5f51,#043b34);color:#fff;max-width:520px}
.payment-card label{color:#dce9e5}.payment-card input,.payment-card select{background:#ffffff14;border-color:#ffffff3d;color:#fff}.payment-card option{color:#173d35}
.demo-badge{display:inline-flex;padding:6px 9px;border-radius:999px;background:#fff2df;color:#8b5b1d;font-size:.72rem;font-weight:800}
.campaign-badge{display:inline-flex;align-items:center;gap:5px;padding:6px 10px;border-radius:999px;font-size:.72rem;font-weight:850;letter-spacing:.03em}
.campaign-badge.boosted{background:#fff0d8;color:#915b18}.campaign-badge.certified{background:#e3f0e9;color:#176048}.campaign-badge.urgent{background:#fde3de;color:#9a2f23}
.sponsorship-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0 0 22px}.sponsor-formula{display:flex;flex-direction:column;align-items:flex-start;gap:9px;padding:19px;border:1px solid var(--crm-line);border-radius:14px;background:#fff}.sponsor-formula strong{font:1.55rem Georgia,serif;color:var(--crm-green)}.sponsor-formula small{color:var(--crm-muted);font-size:.76rem;line-height:1.5}
.upload-zone{border:1px dashed #aebfb4;border-radius:12px;padding:16px;background:#f8faf8}
.upload-zone input{border:0;padding:8px 0;background:transparent}.media-preview{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.media-preview img{width:78px;height:62px;object-fit:cover;border-radius:8px;border:1px solid var(--crm-line)}
.hours-editor{display:grid;gap:7px;margin:14px 0}.hours-row{display:grid;grid-template-columns:110px auto 1fr 1fr;gap:10px;align-items:center;padding:9px 11px;background:#f6f8f6;border-radius:9px}.hours-row label{margin:0;font-weight:700}.hours-row input{margin:0}.hours-row input[type=checkbox]{width:auto}
.category-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:var(--crm-cream);font-size:1.2rem}
.empty{background:#fff;border:1px dashed #cfd8d1;border-radius:14px;padding:40px;text-align:center}

@media(max-width:1180px){.crm-app{grid-template-columns:230px minmax(0,1fr)}.crm-content{padding:26px 24px 55px}.stats{grid-template-columns:repeat(2,1fr)}.crm-table-head,.crm-table-row{grid-template-columns:minmax(190px,1.2fr) 120px 115px minmax(220px,1fr)}}
@media(max-width:860px){
  .crm-app{display:block}.crm-sidebar{position:sticky;height:auto;padding:8px 10px;box-shadow:0 5px 25px #003a3330}.crm-brand{display:none}.crm-nav{flex-direction:row;overflow-x:auto;gap:4px;padding:0}.crm-nav button{width:auto;min-width:max-content;padding:10px 11px;font-size:.75rem}.crm-nav button span{width:auto}.crm-sidebar-footer{display:none}
  .crm-content{padding:22px 16px 45px}.crm-topbar{align-items:flex-start;flex-direction:column;margin-bottom:22px}.crm-top-actions{width:100%;justify-content:flex-start}.crm-search{flex:1;min-width:180px}.crm-overview-grid{grid-template-columns:1fr}.crm-topbar h1{font-size:2.1rem}.metric-card{min-height:145px}.crm-table-head{display:none}.crm-table-row{grid-template-columns:1fr;gap:11px;padding:18px}.crm-table-row .manage-actions{justify-content:flex-start}.crm-card-list{grid-template-columns:1fr}.sponsorship-summary{grid-template-columns:1fr}
}
@media(max-width:560px){
  .portal{padding:24px 16px 60px}.panel{padding:18px}.form-grid{grid-template-columns:1fr}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.metric-card{padding:15px;min-height:126px}.metric-card strong{font-size:2rem;margin:16px 0 8px}.metric-card span{font-size:.68rem}.crm-top-actions .outline{font-size:.7rem;padding:9px}.crm-search{order:3;flex-basis:100%}.panel-heading{align-items:flex-start;flex-direction:column}.manage-card{flex-direction:column}.manage-actions{justify-content:flex-start}.crm-toolbar label{width:100%;align-items:flex-start;flex-direction:column}.crm-toolbar select{width:100%}.hours-row{grid-template-columns:82px auto 1fr 1fr;gap:6px;font-size:.75rem}dialog{padding:22px}
  .auth-portal{min-height:calc(100vh - 48px);padding:22px 13px}.auth-card{padding:26px 20px 25px;border-radius:22px}.auth-logo{width:206px;height:128px;margin-bottom:24px;padding:9px 14px;border-radius:15px}.auth-card h1{font-size:2rem}.auth-intro,.auth-card>p{margin:12px auto 20px;font-size:.84rem}.auth-card form{margin-top:20px}.auth-card label{margin-top:13px}.auth-card input{height:48px}.auth-primary{margin-top:20px}.auth-portal>#message,.auth-portal>#signup-message{top:8px}.signup-page .form-grid{gap:0}
}
