:root{
  --mp-electric:#0014F2;--mp-navy:#001484;--mp-cyan:#00C2FF;--mp-blue:#1D5AFF;--mp-yellow:#FFCA00;--mp-deep:#000F64;--mp-light:#EAEAEA;
}
html[data-theme="light"]{
  --bg:#f5f8fc;--surface:#ffffff;--surface2:#f7f9fc;--ink:#001484;--muted:#667399;--line:#dce5f2;
  --navy:#001484;--blue:#1D5AFF;--bluebg:#eef4ff;--red:#e5484d;--red2:#c62f35;
  --good:#00966d;--goodbg:#e8fbf4;--warn:#b77900;--warnbg:#fff7d6;--bad:#d92d20;--badbg:#fff0ee;
  --shadow:0 1px 2px rgba(0,20,132,.04),0 8px 28px rgba(0,20,132,.07);
  color-scheme:light;
}
html[data-theme="dark"]{
  --bg:#061438;--surface:#0b1c45;--surface2:#102653;--ink:#f7fbff;--muted:#9fb0d3;--line:#203663;
  --navy:#1D5AFF;--blue:#00C2FF;--bluebg:#09275d;--red:#ff6b72;--red2:#ff4f58;
  --good:#39d7a0;--goodbg:#0c3a36;--warn:#FFCA00;--warnbg:#3b3210;--bad:#ff7479;--badbg:#46202b;
  --shadow:0 1px 2px rgba(0,0,0,.15),0 10px 30px rgba(0,0,0,.22);
  color-scheme:dark;
}
html[data-theme="dark"] body{background:linear-gradient(180deg,#061438 0%,#071a3f 100%);color:var(--ink)}
html[data-theme="light"] body{background:linear-gradient(180deg,#f7faff 0%,#f2f6fb 100%);color:var(--ink)}
body.branded-app{min-height:100vh}
body.branded-app .shell{max-width:none;margin:0 0 0 236px;padding:22px 26px 34px;min-height:100vh}
body.branded-app .topbar{margin:-22px -26px 18px;padding:14px 26px;background:color-mix(in srgb,var(--bg) 90%,transparent);border-bottom:1px solid var(--line)}
body.branded-app .topbar-inner{max-width:none}
body.branded-app .brand{min-width:260px}
body.branded-app .brand img{width:250px;height:auto;display:block}
body.branded-app .section-nav{display:none!important}
body.branded-app .btn.primary{background:var(--mp-electric);border-color:var(--mp-electric)}
body.branded-app .btn.primary:hover{background:var(--mp-blue)}
body.branded-app .btn,.theme-mini{background:var(--surface);color:var(--ink);border-color:var(--line)}
body.branded-app .live{color:var(--muted)}
body.branded-app a{color:var(--mp-blue)}
html[data-theme="dark"] body.branded-app a{color:var(--mp-cyan)}

.app-sidebar{position:fixed;z-index:50;inset:0 auto 0 0;width:236px;background:linear-gradient(180deg,#000F64 0%,#001484 100%);color:#fff;padding:22px 14px 18px;display:flex;flex-direction:column;box-shadow:12px 0 36px rgba(0,15,100,.13)}
.app-side-brand{padding:2px 8px 20px}
.app-side-brand img{display:block;width:196px;height:auto}
.app-side-tag{font-size:9px;letter-spacing:.18em;text-transform:uppercase;color:#9edfff;margin:8px 4px 0}
.app-nav{display:flex;flex-direction:column;gap:4px;min-height:0}
.app-nav-btn{appearance:none;border:0;background:transparent;color:#c8d8ff;padding:10px 11px;border-radius:10px;display:flex;align-items:center;gap:10px;font:700 12px/1.2 Inter,system-ui,sans-serif;cursor:pointer;text-align:left;transition:.16s}
.app-nav-btn svg{width:17px;height:17px;flex:0 0 auto;stroke:currentColor}
.app-nav-btn:hover{background:rgba(255,255,255,.08);color:#fff}
.app-nav-btn.active{background:linear-gradient(90deg,#1D5AFF,#0014F2);color:#fff;box-shadow:0 7px 18px rgba(0,20,242,.24)}
.app-side-bottom{margin-top:auto;border-top:1px solid rgba(255,255,255,.12);padding:15px 9px 0}
.app-theme-status{display:flex;align-items:center;gap:8px;color:#dbe8ff;font-size:10px}
.app-theme-dot{width:8px;height:8px;border-radius:50%;background:var(--mp-yellow);box-shadow:0 0 0 4px rgba(255,202,0,.12)}
.app-side-copy{margin-top:9px;font-size:8px;line-height:1.6;letter-spacing:.13em;text-transform:uppercase;color:#8fa8df}

.view-title{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin:2px 0 16px}
.view-title h2{margin:0;font-size:22px;letter-spacing:-.025em;color:var(--ink)}
.view-title p{margin:3px 0 0;color:var(--muted);font-size:12px}
.view-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border:1px solid var(--line);border-radius:999px;background:var(--surface);font-size:10px;color:var(--muted)}

[data-route-section]{display:none!important}
[data-route-section].route-visible{display:block!important}
body[data-view="segment"] #benchmark-section .bm-grid,
body[data-view="segment"] #benchmark-section .bm-kpis{display:none!important}
body[data-view="segment"] #benchmark-section .bm-score-grid{margin-bottom:8px}
body[data-view="trends"] #benchmark-section .bm-headline,
body[data-view="trends"] #benchmark-section #bmTabs,
body[data-view="trends"] #benchmark-section .bm-score-title,
body[data-view="trends"] #benchmark-section .bm-score-grid,
body[data-view="trends"] #benchmark-section .bm-kpis,
body[data-view="trends"] #benchmark-section .bm-grid{display:none!important}
body[data-view="trends"] #changes-section .change-feed{display:none}
body[data-view="trends"] #changes-section .grid2{grid-template-columns:1fr}
body[data-view="trends"] #changes-section .grid2>article:nth-child(2){display:none}

.report-grid,.settings-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.report-card,.setting-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:16px}
.report-icon{width:38px;height:38px;border-radius:11px;background:linear-gradient(135deg,var(--mp-electric),var(--mp-cyan));display:grid;place-items:center;color:#fff;margin-bottom:13px}
.report-card h3,.setting-card h3{font-size:14px;margin:0 0 5px;color:var(--ink)}
.report-card p,.setting-card p{font-size:11px;color:var(--muted);margin:0 0 14px}
.report-actions{display:flex;gap:7px;flex-wrap:wrap}
.theme-choice{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:11px}
.theme-choice button{appearance:none;border:1px solid var(--line);background:var(--surface2);color:var(--ink);border-radius:9px;padding:9px;font-size:10px;font-weight:800;cursor:pointer}
.theme-choice button.active{background:var(--mp-electric);border-color:var(--mp-electric);color:#fff}
.setting-line{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line);font-size:11px}
.setting-line:last-child{border-bottom:0}.setting-line span{color:var(--muted)}.setting-line b{color:var(--ink)}

.theme-mini{appearance:none;width:38px;height:38px;border:1px solid var(--line);border-radius:10px;display:grid;place-items:center;cursor:pointer;font-size:16px}

/* Global light/dark component harmonization */
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .pkg-card,
html[data-theme="dark"] .modal-panel{background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .data-table th{background:#0d204b;color:var(--muted)}
html[data-theme="dark"] .data-table td,
html[data-theme="dark"] .change,
html[data-theme="dark"] .panel-head,
html[data-theme="dark"] .evidence-img{border-color:var(--line)}
html[data-theme="dark"] .data-table tbody tr:hover,
html[data-theme="dark"] .change:hover{background:#102653}
html[data-theme="dark"] .search,
html[data-theme="dark"] .tab,
html[data-theme="dark"] .mini-btn,
html[data-theme="dark"] .icon-btn{background:var(--surface2);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .source-stat,
html[data-theme="dark"] .pkg-metric,
html[data-theme="dark"] .diff,
html[data-theme="dark"] .rank{background:var(--surface2)}
html[data-theme="dark"] .modal-image{background:#061438}

/* Dynamic Market Pulse modules */
html[data-theme="dark"] :is(.mp-pressure,.mp-summary,.mp-mini,.mp-threats,.mp-mix,.bm-score-card,.bm-trend,.bm-kpi,.bm-panel,.bm-seg-mini){background:var(--surface)!important;border-color:var(--line)!important;color:var(--ink)!important}
html[data-theme="dark"] :is(.mp-ring:after){background:var(--surface)!important}
html[data-theme="dark"] :is(.mp-badge,.mp-reason,.mp-action,.bm-rec,.bm-method,.bm-badge,.bm-seg-summary,.bm-chart,.bm-side){background:var(--surface2)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(.mp-window button,.bm-tab,.bm-horizon,.bm-refresh){background:var(--surface)!important;color:var(--muted)!important;border-color:var(--line)!important}
html[data-theme="dark"] :is(.mp-window button.active,.bm-tab.active,.bm-horizon.active){background:var(--mp-electric)!important;color:#fff!important;border-color:var(--mp-electric)!important}
html[data-theme="dark"] .bm-table th{background:#0d204b!important;color:var(--muted)!important}
html[data-theme="dark"] :is(.bm-table td,.mp-move,.bm-source){border-color:var(--line)!important}
html[data-theme="dark"] .bm-score-card.active{outline-color:var(--mp-cyan)!important}
html[data-theme="dark"] .mp-bar{background:#203663!important}
html[data-theme="dark"] .mp-bar i{background:var(--mp-cyan)!important}
html[data-theme="dark"] .bm-chart svg path{stroke:var(--mp-cyan)!important}
html[data-theme="dark"] .bm-chart svg circle{fill:var(--mp-cyan)!important;stroke:var(--surface)!important}

@media(max-width:1050px){
  body.branded-app .shell{margin-left:210px}.app-sidebar{width:210px}.app-side-brand img{width:174px}
  .report-grid,.settings-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:760px){
  body.branded-app{padding-bottom:72px}
  body.branded-app .shell{margin-left:0;padding:12px 13px 28px}
  body.branded-app .topbar{margin:-12px -13px 12px;padding:10px 13px;top:0}
  body.branded-app .brand img{width:180px}
  .app-sidebar{inset:auto 0 0 0;width:auto;height:66px;padding:7px 8px;display:block;background:#000F64;border-top:1px solid rgba(255,255,255,.14);overflow-x:auto;overflow-y:hidden}
  .app-side-brand,.app-side-bottom{display:none}
  .app-nav{flex-direction:row;gap:4px;width:max-content}
  .app-nav-btn{min-width:76px;height:52px;flex-direction:column;justify-content:center;gap:3px;padding:5px 7px;font-size:8px;white-space:nowrap}
  .app-nav-btn svg{width:16px;height:16px}
  .view-title{align-items:flex-start;margin-bottom:12px}.view-title h2{font-size:18px}.view-title p{font-size:10px}.view-chip{display:none}
  .report-grid,.settings-grid{grid-template-columns:1fr}
  .actions .theme-mini{display:grid}
}


/* Theme hardening v2 — all legacy/dynamic components follow semantic colors */
html[data-theme="light"]{--table-head:#f4f7fc;--hover:#f8fbff;--chart-grid:#d9e3f2;--overlay:rgba(0,15,100,.72);--focus:#1D5AFF}
html[data-theme="dark"]{--table-head:#0d214d;--hover:#112a5a;--chart-grid:#29416f;--overlay:rgba(0,5,28,.86);--focus:#00C2FF}

body.branded-app,
body.branded-app :is(.card,.panel,.pkg-card,.report-card,.setting-card,.mp-pressure,.mp-summary,.mp-mini,.mp-threats,.mp-mix,.bm-score-card,.bm-trend,.bm-kpi,.bm-panel,.bm-seg-mini,.executive-card){
  color:var(--ink);
}
body.branded-app :is(.card,.panel,.pkg-card,.report-card,.setting-card,.mp-pressure,.mp-summary,.mp-mini,.mp-threats,.mp-mix,.bm-score-card,.bm-trend,.bm-kpi,.bm-panel,.bm-seg-mini,.executive-card){
  background:var(--surface)!important;border-color:var(--line)!important;
}
body.branded-app :is(.source-stat,.pkg-metric,.diff,.rank,.mp-badge,.mp-reason,.mp-action,.bm-rec,.bm-method,.bm-badge,.bm-seg-summary,.bm-chart,.bm-side,.icon-btn){
  background:var(--surface2)!important;color:var(--ink)!important;border-color:var(--line)!important;
}
body.branded-app :is(.btn,.tab,.mini-btn,.search,.mp-window button,.bm-tab,.bm-horizon,.bm-refresh,.theme-mini){
  background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important;
}
body.branded-app :is(.tab.active,.mp-window button.active,.bm-tab.active,.bm-horizon.active,.mini-btn.primary,.btn.primary){
  background:var(--mp-electric)!important;color:#fff!important;border-color:var(--mp-electric)!important;
}
body.branded-app :is(.btn:hover,.tab:hover,.mini-btn:hover,.bm-refresh:hover,.theme-mini:hover){background:var(--surface2)!important}
body.branded-app .btn.primary:hover{background:var(--mp-blue)!important}
body.branded-app .search::placeholder{color:var(--muted);opacity:.85}
body.branded-app .search:focus{border-color:var(--focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--focus) 16%,transparent)}
body.branded-app :is(.data-table th,.bm-table th){background:var(--table-head)!important;color:var(--muted)!important;border-color:var(--line)!important}
body.branded-app :is(.data-table td,.bm-table td,.value-row,.change,.mp-move,.bm-source,.panel-head,.modal-head,.evidence-img){border-color:var(--line)!important}
body.branded-app :is(.data-table tbody tr:hover,.bm-table tbody tr:hover,.change:hover){background:var(--hover)!important}
body.branded-app .evidence-img{background:var(--surface2)!important}
body.branded-app .modal{background:var(--overlay)!important}
body.branded-app .modal-panel{background:var(--surface)!important;color:var(--ink)!important}
body.branded-app .modal-image{background:var(--bg)!important}
body.branded-app .tl-axis:before{background:var(--line)!important}
body.branded-app .mp-action b,
body.branded-app .bm-rec b,
body.branded-app .bm-side b,
body.branded-app .bm-table td b,
body.branded-app .mp-move-title,
body.branded-app .mp-head strong{color:var(--ink)!important}
body.branded-app :is(.mp-summary p,.mp-meta,.bm-status,.bm-score-meta,.bm-trend-sub,.bm-trend-stat small,.bm-side span,.bm-source small,.bm-method,.mp-note){color:var(--muted)!important}
body.branded-app .mp-bar{background:var(--line)!important}
body.branded-app .mp-bar i{background:var(--blue)!important}
body.branded-app .bm-chart{background:var(--surface2)!important}
body.branded-app .bm-chart svg text{fill:var(--muted)!important}
body.branded-app .bm-chart svg line{stroke:var(--chart-grid)!important}
body.branded-app .bm-chart svg path{stroke:var(--blue)!important}
body.branded-app .bm-chart svg circle{fill:var(--blue)!important;stroke:var(--surface)!important}
body.branded-app .bm-score-card.active{outline-color:var(--focus)!important}
body.branded-app :is(.kpi-value,.hero-value,.source-stat strong,.score,.bm-score-main strong,.bm-trend-stat strong,.bm-kpi strong,.mp-mini strong,.mp-ring strong){text-shadow:none}

/* Executive dashboard */
.executive-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.executive-card{border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:15px;min-width:0;position:relative;overflow:hidden}
.executive-card:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--mp-blue)}
.executive-card.good:before{background:var(--good)}.executive-card.risk:before{background:var(--bad)}.executive-card.action:before{background:var(--mp-yellow)}
.executive-card span{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:850}
.executive-card strong{display:block;margin-top:7px;font-size:18px;line-height:1.15;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.executive-card small{display:block;margin-top:5px;color:var(--muted);font-size:9px;line-height:1.4;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}

/* View-specific information architecture */
body[data-view="compare"] #benchmark-section .bm-score-title,
body[data-view="compare"] #benchmark-section .bm-score-grid,
body[data-view="compare"] #benchmark-section .bm-trend{display:none!important}
body[data-view="compare"] #benchmark-section .bm-seg-summary{display:none!important}
body[data-view="compare"] #benchmark-section .bm-kpis{margin-top:4px}
body[data-view="segment"] #benchmark-section .bm-grid,
body[data-view="segment"] #benchmark-section .bm-kpis{display:none!important}
body[data-view="segment"] #benchmark-section .bm-trend{display:block!important}
body[data-view="trends"] #benchmark-section .bm-trend{margin-bottom:0}
body[data-view="competitor"] #historySection .history-box:not(.open){display:block}
body[data-view="competitor"] #historySection .history-box:not(.open) .table-wrap{display:none}
body[data-view="competitor"] #historySection .history-box:not(.open):after{content:"Bir pakete dokunduğunuzda ürünün tarihsel versiyonları burada açılır.";display:block;padding:22px;color:var(--muted);text-align:center}

/* Light mode gets its own clean accents rather than inheriting legacy whites/blues */
html[data-theme="light"] body.branded-app .topbar{box-shadow:0 1px 0 rgba(0,20,132,.04)}
html[data-theme="light"] .app-theme-dot{background:var(--mp-yellow)}
html[data-theme="light"] body.branded-app :is(.good,.bm-score-trend.up){color:#00835f}
html[data-theme="light"] body.branded-app :is(.bad,.bm-score-trend.down){color:#c7342d}
html[data-theme="light"] body.branded-app .warn{color:#9c6b00}

/* Dark contrast tuning */
html[data-theme="dark"]{--muted:#b6c5e5;--line:#29406e;--surface:#0c1e49;--surface2:#122956;--good:#49e0ad;--bad:#ff8d91;--warn:#ffd84a}
html[data-theme="dark"] body.branded-app .kpi-label,
html[data-theme="dark"] body.branded-app .eyebrow,
html[data-theme="dark"] body.branded-app .source-stat span,
html[data-theme="dark"] body.branded-app .pkg-metric span{color:#b6c5e5}
html[data-theme="dark"] body.branded-app .kpi-value,
html[data-theme="dark"] body.branded-app .hero-value,
html[data-theme="dark"] body.branded-app .source-stat strong,
html[data-theme="dark"] body.branded-app .pkg-metric b,
html[data-theme="dark"] body.branded-app .price{color:#fff}
html[data-theme="dark"] body.branded-app .bm-score-card.strong .bm-score-main strong,
html[data-theme="dark"] body.branded-app .bm-score-card.strong .bm-score-level{color:#63e6b8!important}
html[data-theme="dark"] body.branded-app .bm-score-card.balanced .bm-score-main strong,
html[data-theme="dark"] body.branded-app .bm-score-card.balanced .bm-score-level{color:#ffdc60!important}
html[data-theme="dark"] body.branded-app .bm-score-card.weak .bm-score-main strong,
html[data-theme="dark"] body.branded-app .bm-score-card.weak .bm-score-level{color:#ff989c!important}
html[data-theme="dark"] body.branded-app :is(.mp-score,.bm-pos,.status){font-weight:900}

@media(max-width:1100px){.executive-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){
  .executive-grid{grid-template-columns:1fr 1fr;gap:8px}
  .executive-card{padding:12px}.executive-card strong{font-size:14px}.executive-card small{font-size:8px}
}


/* Reporting center */
.report-grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
.report-status-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px}
.report-status-strip>div{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:11px 12px;box-shadow:var(--shadow)}
.report-status-strip b{display:block;color:var(--ink);font-size:10px;margin-bottom:3px}
.report-status-strip span{display:block;color:var(--muted);font-size:9px;line-height:1.35;word-break:break-word}
.report-history-card{margin-top:12px;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);overflow:hidden}
.report-history{max-height:420px;overflow:auto}
.report-history-table{min-width:920px}
.view-chip.report-ok{background:var(--goodbg);color:var(--good);border-color:color-mix(in srgb,var(--good) 30%,var(--line))}
.view-chip.report-warn{background:var(--warnbg);color:var(--warn);border-color:color-mix(in srgb,var(--warn) 30%,var(--line))}
.report-card .report-icon{font-weight:900;font-size:14px}
.report-card .btn:disabled{opacity:.45}
@media(max-width:900px){.report-status-strip{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.report-grid-4,.report-status-strip{grid-template-columns:1fr}.report-history{max-height:none}}
