@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

/* Fully scoped to avoid Thrive/Theme CSS collisions */
#afcApp.afc-shell{--afc-bg:#f7f5f0;--afc-card:#fff;--afc-ink:#1f211e;--afc-muted:#77766f;--afc-line:#e6dfd2;--afc-gold:#aa7f2c;--afc-gold2:#dfc276;--afc-green:#276b54;--afc-red:#a44037;--afc-blue:#365f7d;--afc-shadow:0 18px 46px rgba(42,37,27,.065);display:block!important;width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;padding:18px!important;box-sizing:border-box!important;overflow:hidden!important;background:var(--afc-bg)!important;color:var(--afc-ink)!important;border-radius:28px!important;font-family:Tajawal,Arial,sans-serif!important;direction:rtl!important;text-align:right!important;line-height:1.55!important}
#afcApp.afc-shell *{box-sizing:border-box!important;min-width:0}
#afcApp.afc-shell button,#afcApp.afc-shell input,#afcApp.afc-shell select,#afcApp.afc-shell textarea{font-family:Tajawal,Arial,sans-serif!important;line-height:1.4!important}
#afcApp.afc-shell h1,#afcApp.afc-shell h2,#afcApp.afc-shell h3,#afcApp.afc-shell p{font-family:Tajawal,Arial,sans-serif!important}

#afcApp .afc-loading{min-height:360px;display:grid!important;place-content:center;justify-items:center;gap:14px}
#afcApp .afc-loading span{width:40px;height:40px;border:4px solid #e6dbc3;border-top-color:var(--afc-gold);border-radius:50%;animation:afcspin .8s linear infinite}@keyframes afcspin{to{transform:rotate(360deg)}}

#afcApp .afc-top{display:block!important;width:100%!important;background:linear-gradient(135deg,#171a17,#292b24 55%,#74571d)!important;color:#fff!important;border-radius:24px!important;padding:28px!important;box-shadow:var(--afc-shadow)!important;position:relative!important;overflow:hidden!important}
#afcApp .afc-top:after{content:"";position:absolute;width:330px;height:330px;border:1px solid rgba(255,255,255,.12);border-radius:50%;left:-120px;top:-170px}
#afcApp .afc-topline{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:18px!important;position:relative;z-index:1}
#afcApp .afc-title{flex:1 1 auto!important}
#afcApp .afc-title h1{margin:0!important;padding:0!important;color:#fff!important;font-size:clamp(30px,4vw,52px)!important;line-height:1.2!important;font-weight:900!important;letter-spacing:0!important;text-transform:none!important}
#afcApp .afc-title p{margin:8px 0 0!important;color:#dedbd2!important;font-size:16px!important;line-height:1.6!important}
#afcApp .afc-actions{display:flex!important;gap:10px!important;flex-wrap:wrap!important;justify-content:flex-start!important}
#afcApp .afc-btn{appearance:none!important;border:0!important;border-radius:12px!important;padding:11px 16px!important;font-size:14px!important;font-weight:800!important;cursor:pointer!important;background:#fff!important;color:#222!important;min-height:42px!important;width:auto!important;box-shadow:none!important;text-decoration:none!important}
#afcApp .afc-btn.gold{background:var(--afc-gold2)!important;color:#211b0d!important}#afcApp .afc-btn.dark{background:#25251f!important;color:#fff!important;border:1px solid #454238!important}#afcApp .afc-btn.danger{background:#fff1ef!important;color:var(--afc-red)!important}

#afcApp .afc-tabs{display:flex!important;width:100%!important;gap:8px!important;overflow-x:auto!important;margin:14px 0 18px!important;padding:4px!important;scrollbar-width:thin}
#afcApp .afc-tab{flex:0 0 auto!important;white-space:nowrap!important;border:1px solid var(--afc-line)!important;background:#fff!important;padding:10px 17px!important;border-radius:999px!important;font-size:14px!important;font-weight:800!important;cursor:pointer!important;color:#605f59!important;min-height:44px!important;width:auto!important;box-shadow:none!important}
#afcApp .afc-tab.active{background:#24241f!important;color:#fff!important;border-color:#24241f!important}

/* Grid: explicit columns instead of 12-column spans, more resilient inside page builders */
#afcApp .afc-grid{display:grid!important;width:100%!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important;align-items:stretch!important}
#afcApp .afc-grid>.afc-card{grid-column:auto!important}
#afcApp .afc-card,#afcApp .afc-panel{display:block!important;width:100%!important;max-width:none!important;background:var(--afc-card)!important;border:1px solid var(--afc-line)!important;border-radius:20px!important;box-shadow:var(--afc-shadow)!important;color:var(--afc-ink)!important}
#afcApp .afc-card{padding:19px!important;min-height:132px!important}
#afcApp .afc-grid>.afc-card:nth-child(n){grid-column:auto!important}
/* Summary rows have four cards: use subgrid-like 4-column layout on wide screens */
#afcApp .afc-grid:has(>.afc-card){grid-template-columns:repeat(4,minmax(0,1fr))!important}
#afcApp .afc-kicker{font-size:13px!important;color:var(--afc-muted)!important;font-weight:800!important;line-height:1.5!important}
#afcApp .afc-number{font-size:clamp(27px,3vw,39px)!important;line-height:1.2!important;font-weight:900!important;margin-top:12px!important;direction:ltr!important;text-align:right!important;color:#1f211e!important;white-space:nowrap!important}
#afcApp .afc-sub{font-size:12px!important;color:#8e8c83!important;margin-top:7px!important;line-height:1.5!important}
#afcApp .afc-panel{padding:20px!important;grid-column:auto!important;min-height:0!important}
#afcApp .afc-panel.full{grid-column:1/-1!important}#afcApp .afc-panel.third{grid-column:auto!important}
#afcApp .afc-panel h2{color:#174b50!important;font-size:22px!important;line-height:1.35!important;font-weight:900!important;margin:0 0 16px!important;padding:0!important;text-transform:none!important}
#afcApp .afc-panel-head{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:12px!important;margin-bottom:15px!important}
#afcApp .afc-panel-head h2{margin:0!important}
#afcApp .afc-pill{display:inline-flex!important;align-items:center!important;font-size:12px!important;line-height:1.3!important;font-weight:900!important;border-radius:999px!important;padding:6px 10px!important;background:#f4efe4!important;color:#78591d!important;white-space:nowrap!important}

#afcApp .afc-progress{height:12px!important;border-radius:999px!important;background:#eee9df!important;overflow:hidden!important;width:100%!important}#afcApp .afc-progress>i{height:100%!important;display:block!important;background:linear-gradient(90deg,#8b6824,#d2ae5c)!important;border-radius:999px!important}#afcApp .afc-progress.green>i{background:linear-gradient(90deg,#246b52,#63a688)!important}#afcApp .afc-progress.red>i{background:linear-gradient(90deg,#a33e35,#d7776c)!important}
#afcApp .afc-budget-row{display:grid!important;grid-template-columns:1fr auto!important;gap:8px!important;margin:13px 0!important;align-items:center!important}#afcApp .afc-budget-row strong{direction:ltr!important;white-space:nowrap!important}
#afcApp .afc-mini-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;margin-top:14px!important}#afcApp .afc-mini{background:#faf8f3!important;border:1px solid #eee8dc!important;border-radius:14px!important;padding:13px!important}#afcApp .afc-mini b{display:block!important;font-size:18px!important;margin-top:5px!important;direction:ltr!important;text-align:right!important}
#afcApp .afc-bars{display:grid!important;gap:12px!important}#afcApp .afc-bar-head{display:flex!important;justify-content:space-between!important;font-size:13px!important;font-weight:800!important;margin-bottom:6px!important;gap:10px!important}#afcApp .afc-bar{height:10px!important;background:#eee9df!important;border-radius:99px!important;overflow:hidden!important}#afcApp .afc-bar i{display:block!important;height:100%!important;background:#a87c25!important;border-radius:99px!important}
#afcApp .afc-insights{display:grid!important;gap:9px!important}#afcApp .afc-insight{padding:12px 14px!important;border-radius:13px!important;background:#f8f6f1!important;border-right:4px solid #777!important;font-size:14px!important;font-weight:700!important}#afcApp .afc-insight.good{border-color:var(--afc-green)!important;background:#f0f7f4!important}#afcApp .afc-insight.warn{border-color:#c8872c!important;background:#fff7eb!important}#afcApp .afc-insight.info{border-color:var(--afc-blue)!important;background:#f2f6fa!important}

#afcApp .afc-plan-hero{display:grid!important;grid-template-columns:1fr auto!important;gap:16px!important;align-items:center!important;padding:18px!important;border-radius:16px!important;background:linear-gradient(135deg,#f8f3e7,#fff)!important}#afcApp .afc-plan-big{font-size:36px!important;font-weight:900!important;direction:ltr!important;text-align:right!important;white-space:nowrap!important}#afcApp .afc-goals{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:11px!important;margin-top:15px!important}#afcApp .afc-goal{padding:14px!important;border:1px solid #eee6d6!important;border-radius:15px!important;background:#fff!important}#afcApp .afc-goal-top{display:flex!important;justify-content:space-between!important;gap:8px!important;align-items:center!important;margin-bottom:8px!important}#afcApp .afc-goal .amt{font-weight:900!important;direction:ltr!important}#afcApp .afc-goal small{color:var(--afc-muted)!important}
#afcApp .afc-phase{border:1px solid #e6d5ae!important;background:#fffaf0!important;border-radius:17px!important;padding:16px!important}#afcApp .afc-phase h3{color:#174b50!important;font-size:28px!important;line-height:1.3!important;margin:0 0 7px!important;font-weight:900!important}#afcApp .afc-phase-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin-top:12px!important}#afcApp .afc-phase-item{background:#fff!important;border:1px solid #f0e5cf!important;border-radius:12px!important;padding:10px!important;display:flex!important;justify-content:space-between!important;gap:8px!important}
#afcApp .afc-chart{height:200px!important;display:flex!important;align-items:flex-end!important;gap:8px!important;padding:12px 4px 0!important;overflow-x:auto!important}#afcApp .afc-col{flex:1 0 58px!important;display:flex!important;flex-direction:column!important;align-items:center!important;gap:5px!important}#afcApp .afc-col i{width:80%!important;max-width:45px!important;background:linear-gradient(#d1b16a,#8f6b28)!important;border-radius:8px 8px 3px 3px!important;min-height:4px!important}#afcApp .afc-col span,#afcApp .afc-col b{font-size:10px!important;white-space:nowrap!important}#afcApp .afc-col span{color:var(--afc-muted)!important}#afcApp .afc-col b{direction:ltr!important}

#afcApp .afc-table-wrap{overflow:auto!important;border:1px solid var(--afc-line)!important;border-radius:14px!important;width:100%!important}#afcApp .afc-table{width:100%!important;border-collapse:collapse!important;min-width:850px!important;background:#fff!important}#afcApp .afc-table th,#afcApp .afc-table td{padding:12px!important;border-bottom:1px solid #eee9df!important;text-align:right!important;font-size:13px!important;line-height:1.5!important;color:#292a27!important}#afcApp .afc-table th{background:#faf8f3!important;font-weight:900!important}#afcApp .afc-tag{display:inline-flex!important;padding:5px 8px!important;border-radius:999px!important;background:#f2eee5!important;font-size:11px!important;font-weight:900!important}#afcApp .afc-tag.income{background:#e9f5ef!important;color:#21624b!important}#afcApp .afc-tag.expense{background:#fff0ed!important;color:#943e36!important}#afcApp .afc-tag.allocation{background:#fff6df!important;color:#86611d!important}

#afcApp .afc-modal{position:fixed!important;inset:0!important;background:rgba(16,16,14,.55)!important;z-index:999999!important;display:grid!important;place-items:center!important;padding:15px!important}#afcApp .afc-dialog{width:min(650px,100%)!important;max-height:92vh!important;overflow:auto!important;background:#fff!important;border-radius:22px!important;padding:20px!important}#afcApp .afc-dialog h2{color:#174b50!important;margin:0 0 15px!important;font-weight:900!important}#afcApp .afc-form{display:grid!important;grid-template-columns:1fr 1fr!important;gap:12px!important}#afcApp .afc-field{display:grid!important;gap:6px!important}#afcApp .afc-field.full{grid-column:1/-1!important}#afcApp .afc-field label{font-size:12px!important;font-weight:800!important;color:#615f58!important}#afcApp .afc-field input,#afcApp .afc-field select,#afcApp .afc-field textarea{width:100%!important;border:1px solid #ddd5c6!important;border-radius:11px!important;padding:11px!important;background:#fff!important;color:#222!important;min-height:43px!important}#afcApp .afc-dialog-actions{display:flex!important;gap:9px!important;justify-content:flex-start!important;margin-top:15px!important}.afc-empty{text-align:center;color:#77766f;padding:28px}
#afcApp .afc-settings{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important}#afcApp .afc-settings .afc-field{background:#faf8f3!important;padding:13px!important;border-radius:13px!important;border:1px solid #eee7da!important}
.afc-notice{position:fixed;left:20px;bottom:20px;z-index:1000000;background:#20201c;color:#fff;padding:12px 16px;border-radius:12px;box-shadow:0 18px 45px rgba(39,35,26,.12);font-family:Tajawal,Arial,sans-serif}

@media(max-width:1050px){
 #afcApp .afc-grid:has(>.afc-card){grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #afcApp .afc-settings{grid-template-columns:1fr 1fr!important}
}
@media(max-width:720px){
 #afcApp.afc-shell{padding:10px!important;border-radius:18px!important}
 #afcApp .afc-top{padding:20px!important}
 #afcApp .afc-topline{display:grid!important;grid-template-columns:1fr!important}
 #afcApp .afc-actions{justify-content:stretch!important}#afcApp .afc-actions .afc-btn{flex:1 1 auto!important}
 #afcApp .afc-grid,#afcApp .afc-grid:has(>.afc-card){grid-template-columns:1fr!important}
 #afcApp .afc-card{min-height:104px!important}
 #afcApp .afc-number{font-size:29px!important}
 #afcApp .afc-mini-grid,#afcApp .afc-goals,#afcApp .afc-phase-grid,#afcApp .afc-settings,#afcApp .afc-form{grid-template-columns:1fr!important}
 #afcApp .afc-field.full{grid-column:auto!important}
 #afcApp .afc-plan-hero{grid-template-columns:1fr!important}
 #afcApp .afc-panel-head{align-items:flex-start!important}
}

/* v3.3 UX hardening */
#afcApp .afc-content{margin-top:14px!important}
#afcApp .afc-summary-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:14px!important}
#afcApp .afc-main-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important;margin-top:14px!important}
#afcApp .afc-main-grid>.full{grid-column:1/-1!important}
#afcApp .afc-number{font-size:clamp(22px,2.1vw,34px)!important;white-space:normal!important;overflow-wrap:anywhere!important;letter-spacing:-.02em!important}
#afcApp .afc-negative{color:#a33e35!important}
#afcApp .afc-period-wrap{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:14px!important;background:#fff!important;border:1px solid #e7dfd2!important;border-radius:18px!important;padding:13px 15px!important;margin-top:12px!important;box-shadow:0 10px 30px rgba(40,35,25,.04)!important}
#afcApp .afc-period-title{display:flex!important;align-items:center!important;gap:9px!important;white-space:nowrap!important}#afcApp .afc-period-title span{color:#8a877f!important;font-size:13px!important}
#afcApp .afc-periods{display:flex!important;align-items:center!important;gap:7px!important;flex-wrap:wrap!important}#afcApp .afc-period{border:1px solid #e2dacd!important;background:#faf8f3!important;color:#5d5b54!important;border-radius:999px!important;padding:9px 14px!important;font-weight:800!important;cursor:pointer!important}#afcApp .afc-period.active{background:#20211e!important;color:#fff!important;border-color:#20211e!important}
#afcApp .afc-month-picker{display:flex!important;align-items:center!important;gap:7px!important;border:1px solid #e2dacd!important;border-radius:999px!important;padding:5px 10px!important;background:#fff!important;font-size:12px!important;font-weight:800!important}#afcApp .afc-month-picker input{border:0!important;background:transparent!important;padding:3px!important;min-height:auto!important;width:125px!important}
#afcApp .afc-section-head{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:18px!important;background:linear-gradient(135deg,#fff,#faf7f0)!important;border:1px solid #e8dfd0!important;border-radius:20px!important;padding:20px!important;margin-bottom:14px!important}#afcApp .afc-section-head h2{font-size:28px!important;color:#174b50!important;margin:4px 0!important}#afcApp .afc-section-head p{margin:0!important;color:#77736c!important}
#afcApp .afc-eyebrow{display:inline-block!important;color:#987121!important;font-size:12px!important;font-weight:900!important;letter-spacing:.02em!important}
#afcApp .afc-stat-chip{min-width:180px!important;text-align:center!important;background:#20211e!important;color:#fff!important;border-radius:16px!important;padding:14px 18px!important}#afcApp .afc-stat-chip b{display:block!important;font-size:24px!important;direction:ltr!important}#afcApp .afc-stat-chip small{color:#d9d4c9!important}
#afcApp .afc-analytics-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important}#afcApp .afc-analytics-grid>.full{grid-column:1/-1!important}
#afcApp .afc-budget-big{font-size:clamp(30px,4vw,48px)!important;font-weight:900!important;direction:ltr!important;text-align:right!important;margin:10px 0 2px!important}
#afcApp .afc-phase-main{display:flex!important;justify-content:space-between!important;align-items:flex-start!important;gap:12px!important;margin-bottom:12px!important}#afcApp .afc-phase-total{text-align:left!important;direction:ltr!important;white-space:nowrap!important}#afcApp .afc-phase-total b{display:block!important;font-size:23px!important}#afcApp .afc-phase-total small{color:#8c887f!important}
#afcApp .afc-phase-item{align-items:center!important}#afcApp .afc-phase-item span,#afcApp .afc-phase-item small{display:block!important}#afcApp .afc-phase-item small{font-size:11px!important;color:#8c887f!important;margin-top:3px!important}#afcApp .afc-phase-item-num{text-align:left!important;direction:ltr!important}
#afcApp .afc-goal-meta{display:flex!important;justify-content:space-between!important;gap:8px!important;margin-top:7px!important;font-size:11px!important;color:#858178!important}
#afcApp .afc-plan-score{min-width:130px!important;text-align:center!important;background:#20211e!important;color:#fff!important;padding:18px!important;border-radius:18px!important}#afcApp .afc-plan-score b{display:block!important;font-size:32px!important}#afcApp .afc-plan-score small{color:#d9d4c9!important}
#afcApp .afc-plan-big small{font-size:.45em!important;color:#77736c!important}
#afcApp .afc-dialog-head{display:flex!important;justify-content:space-between!important;align-items:flex-start!important;gap:12px!important;margin-bottom:15px!important}#afcApp .afc-dialog-head h2{margin:3px 0 0!important}#afcApp .afc-close{border:0!important;background:#f2eee6!important;width:38px!important;height:38px!important;border-radius:50%!important;font-size:25px!important;line-height:1!important;cursor:pointer!important;color:#333!important}
#afcApp .afc-dialog-actions{padding-top:14px!important;border-top:1px solid #eee8dc!important}
#afcApp .afc-field input,#afcApp .afc-field select,#afcApp .afc-field textarea{font-size:15px!important}
#afcApp .afc-settings-action{grid-column:1/-1!important}
@media(max-width:1050px){#afcApp .afc-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:760px){#afcApp .afc-period-wrap,#afcApp .afc-section-head,#afcApp .afc-phase-main{align-items:stretch!important;flex-direction:column!important}#afcApp .afc-period-title{justify-content:space-between!important}#afcApp .afc-periods{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important}#afcApp .afc-period,#afcApp .afc-month-picker{justify-content:center!important;width:100%!important}#afcApp .afc-summary-grid,#afcApp .afc-main-grid,#afcApp .afc-analytics-grid{grid-template-columns:1fr!important}#afcApp .afc-stat-chip{width:100%!important}#afcApp .afc-phase-total{text-align:right!important}#afcApp .afc-goals{grid-template-columns:1fr!important}}
