/* overview-page.css — Genel Bakis (dashboard+raporlar) bilesenleri + grafik kiti
 * Mevcut design-system token'larina dayanir (--primary #681620 vb.) */

/* ---------- duzen ---------- */
.ov-section-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:26px 0 12px; flex-wrap:wrap; }
.ov-section-head .section-title { margin:0; }
.ov-section-head .ov-range { font-size:12px; color:var(--text-tertiary); font-variant-numeric:tabular-nums; }
.ov-live-tag { display:inline-flex; align-items:center; gap:5px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--success); background:var(--success-soft); padding:2px 8px; border-radius:var(--radius-full); }
.ov-live-tag::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--success); box-shadow:0 0 0 0 rgba(22,163,74,.5); animation:ov-pulse 1.8s infinite; }
@keyframes ov-pulse { 0%{box-shadow:0 0 0 0 rgba(22,163,74,.45);} 70%{box-shadow:0 0 0 6px rgba(22,163,74,0);} 100%{box-shadow:0 0 0 0 rgba(22,163,74,0);} }

.ov-main { display:grid; grid-template-columns:1.9fr 1fr; gap:16px; margin-bottom:16px; }
.ov-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.ov-grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:16px; }
@media (max-width:1100px){ .ov-main,.ov-grid-2,.ov-grid-3 { grid-template-columns:1fr; } }
@media (max-width:680px){ .ov-grid-3 { grid-template-columns:1fr; } }

/* KPI: delta + sparkline */
.kpi { position:relative; overflow:hidden; }
.kpi.ov-click { cursor:pointer; }
.kpi.ov-click:hover { border-color:var(--primary); box-shadow:var(--shadow-sm); }
.ov-kpi-top { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.ov-kpi-spark { flex-shrink:0; opacity:.9; margin-top:2px; }
.kpi-trend em { font-style:normal; color:var(--text-tertiary); font-weight:500; }
.kpi-trend.flat { color:var(--text-tertiary); }
.ov-kpi-sub { font-size:11.5px; color:var(--text-tertiary); margin-top:2px; }
.ov-mini { font-size:11px; color:var(--text-secondary); }

/* period bar — ozel tarih */
.ov-period { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:16px; padding:8px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); position:sticky; top:var(--topbar-h,56px); z-index:30; }
.ov-period a { padding:6px 14px; border-radius:var(--radius); text-decoration:none; color:var(--text); font-size:13px; font-weight:500; white-space:nowrap; }
.ov-period a.active { background:var(--primary); color:#fff; }
.ov-period a:hover:not(.active) { background:var(--surface-hover); }
.ov-period .ov-custom { display:flex; gap:6px; align-items:center; margin-left:auto; }
.ov-period input[type=date]{ border:1px solid var(--border); border-radius:var(--radius-sm); padding:5px 8px; font-size:12px; font-family:inherit; color:var(--text); background:var(--surface); }

/* ---------- grafik tooltip ---------- */
.chart-tip { position:fixed; z-index:9999; pointer-events:none; display:none; background:rgba(20,20,22,.94); color:#fff; padding:7px 10px; border-radius:8px; font-size:12px; line-height:1.35; box-shadow:0 6px 20px rgba(0,0,0,.25); max-width:240px; }
.chart-tip-t { font-size:11px; color:#cfcfd4; }
.chart-tip-v { font-weight:700; font-size:13px; font-variant-numeric:tabular-nums; }
.chart-tip-s { font-size:11px; color:#a7a7ae; margin-top:1px; }
.chart-empty { padding:30px 12px; text-align:center; color:var(--text-tertiary); font-size:13px; }

/* ---------- areaLine ---------- */
.cx-wrap { width:100%; }
.cx-svg { width:100%; height:auto; display:block; }
.cx-grid { stroke:var(--border); stroke-width:1; opacity:.7; }
.cx-zero { stroke:var(--border-strong); stroke-width:1.2; }
.cx-axis { font-size:10px; fill:var(--text-tertiary); font-family:var(--font-sans); }
.cx-area { opacity:0; animation:cx-fade .9s ease forwards .15s; }
@keyframes cx-fade { to { opacity:1; } }
.cx-anim { stroke-dasharray:1; stroke-dashoffset:1; animation:cx-draw 1.1s cubic-bezier(.4,.1,.2,1) forwards; animation-delay:var(--cxdelay,0s); }
@keyframes cx-draw { to { stroke-dashoffset:0; } }
.cx-dot { transition:r .15s; }
.cx-legend { display:flex; gap:16px; flex-wrap:wrap; margin-bottom:8px; }
.cx-leg { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--text-secondary); font-weight:500; }
.cx-leg i { width:14px; height:3px; border-radius:2px; display:inline-block; }
.cx-leg.dashed i { background:repeating-linear-gradient(90deg,currentColor 0 4px,transparent 4px 7px)!important; opacity:.6; }

/* ---------- donut ---------- */
.cx-donut-wrap { display:flex; gap:18px; align-items:center; flex-wrap:wrap; }
.cx-donut { flex-shrink:0; }
.cx-seg { transition:opacity .15s, transform .15s; transform-origin:center; cursor:default; }
.cx-seg:hover { opacity:.82; }
.cx-donut-c { font-size:21px; font-weight:700; fill:var(--text); font-variant-numeric:tabular-nums; }
.cx-donut-l { font-size:10px; font-weight:600; fill:var(--text-tertiary); text-transform:uppercase; letter-spacing:.5px; }
.cx-dlegend { flex:1; min-width:150px; }
.cx-dleg { display:flex; align-items:center; gap:8px; padding:5px 0; border-bottom:1px solid var(--border); font-size:12.5px; }
.cx-dleg:last-child { border-bottom:none; }
.cx-dot2 { width:10px; height:10px; border-radius:3px; flex-shrink:0; }
.cx-dleg-l { flex:1; color:var(--text); font-weight:500; }
.cx-dleg-v { color:var(--text-secondary); font-variant-numeric:tabular-nums; }
.cx-dleg-v em { font-style:normal; color:var(--text-tertiary); font-size:11px; }

/* ---------- yatay bar ---------- */
.cx-bars { display:flex; flex-direction:column; gap:10px; }
.cx-bar-row { display:grid; grid-template-columns:minmax(90px,30%) 1fr auto; align-items:center; gap:10px; font-size:12.5px; cursor:default; }
.cx-bar-lbl { color:var(--text); font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cx-bar-track { height:9px; background:var(--surface-hover); border-radius:var(--radius-full); overflow:hidden; }
.cx-bar-fill { display:block; height:100%; border-radius:var(--radius-full); transform-origin:left; animation:cx-grow .8s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes cx-grow { from { transform:scaleX(0); } to { transform:scaleX(1); } }
.cx-bar-val { font-weight:600; color:var(--text); font-variant-numeric:tabular-nums; white-space:nowrap; }

/* ---------- isi haritasi ---------- */
.cx-hm { overflow-x:auto; padding-bottom:4px; }
.cx-hm-row { display:grid; grid-template-columns:34px repeat(24,1fr); gap:3px; align-items:center; min-width:560px; }
.cx-hm-row + .cx-hm-row { margin-top:3px; }
.cx-hm-head { margin-bottom:3px; }
.cx-hm-h { font-size:9px; color:var(--text-tertiary); text-align:center; }
.cx-hm-d { font-size:11px; color:var(--text-secondary); font-weight:600; }
.cx-hm-cell { height:20px; border-radius:3px; cursor:default; transition:transform .1s, box-shadow .1s; font-size:0; }
.cx-hm-cell:hover { transform:scale(1.18); box-shadow:0 0 0 1px var(--primary); position:relative; z-index:2; }
.cx-hm-scale { display:flex; align-items:center; gap:8px; margin-top:10px; font-size:11px; color:var(--text-tertiary); }
.cx-hm-grad { flex:1; max-width:160px; height:8px; border-radius:var(--radius-full); background:linear-gradient(90deg,rgba(104,22,32,.08),rgba(104,22,32,1)); }

/* ---------- gauge / hedef ---------- */
.cx-gauge { margin-bottom:16px; }
.cx-gauge:last-child { margin-bottom:0; }
.cx-gauge-head { display:flex; justify-content:space-between; align-items:baseline; font-size:13px; margin-bottom:7px; }
.cx-gauge-head span { color:var(--text-secondary); font-weight:500; }
.cx-gauge-head b { font-size:16px; color:var(--text); font-variant-numeric:tabular-nums; }
.cx-gauge-track { position:relative; height:14px; background:var(--surface-hover); border-radius:var(--radius-full); overflow:visible; }
.cx-gauge-fill { position:absolute; left:0; top:0; height:100%; border-radius:var(--radius-full); transform-origin:left; animation:cx-grow .9s cubic-bezier(.2,.7,.2,1) forwards; }
.cx-gauge-target { position:absolute; top:-3px; width:3px; height:20px; background:var(--text); border-radius:2px; transform:translateX(-50%); }
.cx-gauge-target::after { content:'▾'; position:absolute; top:-13px; left:50%; transform:translateX(-50%); font-size:9px; color:var(--text); }
.cx-gauge-proj { position:absolute; top:-1px; width:2px; height:16px; background:var(--info); transform:translateX(-50%); border-radius:2px; }
.cx-gauge-foot { display:flex; justify-content:space-between; font-size:11px; color:var(--text-tertiary); margin-top:6px; font-variant-numeric:tabular-nums; }
.cx-gauge-projtxt { color:var(--info)!important; }
.cx-gauge-hint { font-size:12px; color:var(--text-tertiary); margin-top:4px; }
.cx-gauge-hint a { color:var(--primary); font-weight:600; }
.cx-gauge.no-target .cx-gauge-head b { font-size:16px; }

.cx-spark { display:block; }

/* ---------- envanter mini ---------- */
.ov-inv-stats { display:flex; gap:18px; flex-wrap:wrap; margin-bottom:14px; }
.ov-inv-stat .v { font-size:20px; font-weight:700; color:var(--text); font-variant-numeric:tabular-nums; }
.ov-inv-stat .l { font-size:11px; color:var(--text-tertiary); text-transform:uppercase; letter-spacing:.4px; }

/* ---------- son hareketler / iletisim (mevcut stilleri tamamlar) ---------- */
.ov-feed { max-height:360px; overflow-y:auto; }

/* tablo net hizalama */
.ov-num { text-align:right; font-variant-numeric:tabular-nums; }
.ov-neg { color:var(--danger); }
.ov-pos { color:var(--success); }
.ov-total-row { background:var(--primary-soft); font-weight:700; }
.ov-total-row td { border-top:2px solid var(--border-strong)!important; }

@media (prefers-reduced-motion: reduce) {
  .cx-anim,.cx-area,.cx-bar-fill,.cx-gauge-fill,.ov-live-tag::before { animation:none!important; }
  .cx-anim { stroke-dashoffset:0; } .cx-area { opacity:1; }
  .cx-bar-fill,.cx-gauge-fill { transform:none; }
}
