/* ============================================================
   Aylık Kâr-Zarar Trendı — single-screen dashboard
   Model: İşletme Maliyetleri (biz-dash). No page scrollbar;
   every panel sized to the viewport via a flex chain.
   Rows: command bar 42 · KPI 80 · charts flex · table auto(12 ay)
   ============================================================ */

#app.theme-dashboard-pro.view-finance.view-pltrend #content{
  overflow:hidden !important;
  padding:10px 24px 12px !important;
  background:#0F1117 !important;
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  display:flex !important;
  flex-direction:column;
  min-height:0;
  height:auto;
}

.plt-page{
  --plt-bg:#0F1117;
  --plt-card:#171A22;
  --plt-card-2:#1B1F29;
  --plt-border:#2A2F3A;
  --plt-gold:#D6B04D;
  --plt-gold-soft:rgba(214,176,77,.14);
  --plt-text:#FFFFFF;
  --plt-muted:#9CA3AF;
  --plt-neg:#E45D5D;
  --plt-pos:#62D26F;
  --plt-gap:8px;
  --plt-ease:0.25s ease;

  color:var(--plt-text);
  display:flex;
  flex-direction:column;
  gap:var(--plt-gap);
  flex:1 1 0%;
  min-height:0;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  overflow:hidden;
  animation:pltEnter .4s cubic-bezier(.22,1,.36,1) both;
}
.plt-page *,
.plt-page *::before,
.plt-page *::after{box-sizing:border-box}

@keyframes pltEnter{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}

/* ---------- Command bar: h:42, title left / filters right ---------- */
.plt-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:38px;
  flex:0 0 auto;
}
.plt-head-left{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
.plt-title{
  margin:0;
  font-size:18px;
  font-weight:700;
  letter-spacing:.02em;
  line-height:1.1;
  color:var(--plt-text);
  white-space:nowrap;
}
.plt-sub{
  margin:0;
  font-size:11px;
  font-weight:500;
  color:var(--plt-muted);
  letter-spacing:.01em;
  white-space:nowrap;
}

.plt-toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:nowrap;
  justify-content:flex-end;
  min-width:0;
}
.plt-filter{
  display:inline-flex;
  align-items:center;
  gap:8px;
  height:36px;
  width:172px;
  flex:0 0 172px;
  padding:0 12px;
  border:1px solid var(--plt-border);
  border-radius:8px;
  background:var(--plt-card);
  transition:border-color var(--plt-ease), box-shadow var(--plt-ease);
}
.plt-filter:hover,
.plt-filter:focus-within{
  border-color:rgba(214,176,77,.55);
  box-shadow:0 0 0 3px var(--plt-gold-soft);
}
.plt-filter-lab{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:10px;
  font-weight:600;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--plt-gold);
  white-space:nowrap;
  flex:0 0 auto;
}
.plt-filter-inp{
  border:0;
  border-radius:0;
  background:transparent;
  padding:0;
  margin:0;
  height:auto;
  color:var(--plt-text);
  font:inherit;
  font-size:12.5px;
  font-weight:600;
  width:100%;
  min-width:0;
  outline:none;
  color-scheme:dark;
  cursor:pointer;
}
.plt-filter-select{appearance:none;background-image:none}

.plt-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  height:36px;
  padding:0 14px;
  border:1px solid var(--plt-border);
  border-radius:8px;
  background:var(--plt-card);
  color:var(--plt-text);
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  transition:transform var(--plt-ease), box-shadow var(--plt-ease), border-color var(--plt-ease);
  white-space:nowrap;
}
.plt-btn-primary{
  background:linear-gradient(180deg,#E0C05E 0%,var(--plt-gold) 100%);
  color:#141414;
  border-color:transparent;
  box-shadow:0 4px 14px rgba(214,176,77,.16);
  position:relative;
  overflow:hidden;
}
.plt-btn-primary::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(105deg,transparent 35%,rgba(255,255,255,.35) 50%,transparent 65%);
  transform:translateX(-120%);
  transition:transform .55s ease;
}
.plt-btn-primary:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 20px rgba(214,176,77,.26);
}
.plt-btn-primary:hover::after{transform:translateX(120%)}
.plt-btn-primary:active{transform:translateY(0)}

.plt-ico{display:inline-flex;width:13px;height:13px;color:currentColor;flex:0 0 auto}
.plt-ico svg{width:100%;height:100%;display:block}

/* ---------- Body: flex chain, no page scroll ---------- */
.plt-body{
  display:flex;
  flex-direction:column;
  gap:var(--plt-gap);
  flex:1 1 0%;
  min-height:0;
  overflow:visible;
}
.plt-body > .plt-charts,
.plt-body > .plt-table-panel{
  /* KPI tooltip taşmasın diye board/table kendi clip’ini korur */
  position:relative;
  z-index:1;
}

/* ---------- KPI strip: h:80 ---------- */
.plt-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:var(--plt-gap);
  flex:0 0 auto;
  overflow:visible;
  position:relative;
  z-index:30;
}
.plt-kpi{
  position:relative;
  height:72px;
  background:linear-gradient(180deg,var(--plt-card-2) 0%,var(--plt-card) 100%);
  border:1px solid var(--plt-border);
  border-radius:12px;
  padding:9px 14px;
  box-shadow:0 4px 14px rgba(0,0,0,.18);
  transition:transform var(--plt-ease), box-shadow var(--plt-ease), border-color var(--plt-ease);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.plt-kpi[data-help]{
  overflow:visible;
  cursor:default;
}
.plt-kpi::before{
  content:"";
  position:absolute;
  inset:0 auto auto 0;
  width:100%;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(214,176,77,.35),transparent);
  opacity:.7;
}
.plt-kpi:hover,.plt-kpi:focus-visible,.plt-kpi.is-help-open{
  transform:translateY(-2px);
  border-color:rgba(214,176,77,.45);
  box-shadow:0 8px 18px rgba(0,0,0,.28);
}
.plt-kpi-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  font-size:10.5px;
  color:var(--plt-muted);
  font-weight:600;
  letter-spacing:.05em;
  text-transform:uppercase;
  line-height:1.2;
}
.plt-kpi-top > span{
  display:inline-flex;
  align-items:center;
  min-width:0;
  padding-top:2px;
}
.plt-kpi-badge{
  width:26px;
  height:26px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1.5px solid currentColor;
  background:transparent;
  flex:0 0 auto;
}
.plt-kpi-badge .plt-ico{width:13px;height:13px}
.plt-kpi-badge.is-neg{color:var(--plt-neg);background:rgba(228,93,93,.12)}
.plt-kpi-badge.is-pos{color:var(--plt-pos);background:rgba(98,210,111,.12)}
.plt-kpi-badge.is-gold{color:var(--plt-gold);background:var(--plt-gold-soft)}
.plt-kpi-badge.is-muted{color:rgba(255,255,255,.72);border-color:rgba(255,255,255,.28);background:rgba(255,255,255,.04)}

.plt-kpi-val{
  font-size:clamp(16px,1.25vw,19px);
  font-weight:700;
  line-height:1;
  color:var(--plt-text);
  font-variant-numeric:tabular-nums;
  letter-spacing:-.01em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.plt-kpi-val.is-neg{color:var(--plt-neg)}
.plt-kpi-val.is-pos{color:var(--plt-pos)}
.plt-kpi-val.is-gold{color:var(--plt-gold)}
.plt-kpi-val.is-muted{color:rgba(255,255,255,.72)}
.plt-kpi-hint{
  font-size:10.5px;
  color:var(--plt-muted);
  font-weight:500;
  line-height:1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* ---------- Charts: flexible middle band (62/38) ---------- */
.plt-charts{
  display:grid;
  grid-template-columns:minmax(0,62fr) minmax(0,38fr);
  gap:var(--plt-gap);
  align-items:stretch;
  flex:1 1 0%;
  min-height:126px;
  max-height:340px;
}
.plt-panel{
  background:var(--plt-card);
  border:1px solid var(--plt-border);
  border-radius:12px;
  padding:10px 14px;
  display:flex;
  flex-direction:column;
  min-height:0;
  min-width:0;
  box-shadow:0 4px 14px rgba(0,0,0,.16);
}
.plt-chart-main,
.plt-chart-side{height:auto}
.plt-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:6px;
  height:20px;
  flex:0 0 auto;
}
.plt-sec-title{
  margin:0;
  font-size:12px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--plt-gold);
  white-space:nowrap;
}
.plt-legend{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;min-width:0;overflow:hidden}
.plt-leg{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:10px;
  font-weight:500;
  color:var(--plt-muted);
  white-space:nowrap;
}
.plt-leg-line{width:14px;height:3px;background:var(--plt-gold);border-radius:2px;display:inline-block}
.plt-leg-bar{width:8px;height:8px;background:#3E4452;border-radius:2px;display:inline-block}

.plt-chart-wrap{
  position:relative;
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.plt-chart-wrap svg{
  width:100%;
  flex:1 1 auto;
  min-height:0;
  display:block;
}
.plt-bar{fill:#3E4452;transition:fill .2s ease}
.plt-bar:hover{fill:#4A5162}
.plt-dot{transition:r .15s ease;cursor:pointer}
.plt-chart-labels{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(0,1fr));
  gap:0;
  margin-top:2px;
  height:14px;
  font-size:9.5px;
  color:var(--plt-muted);
  text-align:center;
  font-weight:500;
  flex:0 0 auto;
  overflow:hidden;
}

.plt-tip{
  position:absolute;
  z-index:5;
  pointer-events:none;
  min-width:128px;
  padding:8px 10px;
  border-radius:8px;
  background:rgba(15,17,23,.94);
  border:1px solid var(--plt-border);
  box-shadow:0 10px 26px rgba(0,0,0,.4);
  color:var(--plt-text);
  font-size:11px;
  line-height:1.4;
  opacity:0;
  transform:translateY(4px);
  transition:opacity .15s ease, transform .15s ease;
}
.plt-tip.is-on{opacity:1;transform:translateY(0)}
.plt-tip b{display:block;color:var(--plt-gold);font-size:10px;font-weight:700;margin-bottom:3px;letter-spacing:.03em;text-transform:uppercase}
.plt-tip span{display:block;color:rgba(255,255,255,.88);font-variant-numeric:tabular-nums}

/* ---------- Table: 12 rows fit without scroll on 768 ---------- */
.plt-table-panel{
  flex:0 1 auto;
  min-height:0;
  padding:8px 18px 10px;
  overflow:hidden;
}
.plt-table-panel .plt-sec-title{margin-bottom:5px;height:18px;line-height:18px;flex:0 0 auto}
.plt-table-wrap{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  border:1px solid var(--plt-border);
  border-radius:8px;
  background:rgba(0,0,0,.12);
}
.plt-table-wrap::-webkit-scrollbar{width:7px;height:7px}
.plt-table-wrap::-webkit-scrollbar-track{background:transparent}
.plt-table-wrap::-webkit-scrollbar-thumb{
  background:rgba(214,176,77,.28);
  border-radius:999px;
}
.plt-table-wrap::-webkit-scrollbar-thumb:hover{background:rgba(214,176,77,.45)}

.plt-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
  font-size:10px;
  background:transparent !important;
  color:var(--plt-text);
}
.plt-table thead th{
  position:sticky;
  top:0;
  z-index:2;
  height:27px;
  padding:0 18px;
  text-align:left;
  font-size:9px;
  font-weight:700;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--plt-gold) !important;
  background:#1B1F29 !important;
  border-bottom:1px solid var(--plt-border);
  border-top:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.plt-table thead th:not(:first-child),
.plt-table td.plt-num{text-align:right}
.plt-table thead th:first-child{width:110px}
.plt-table thead th:last-child{width:110px}

.plt-table tbody td{
  height:23px;
  padding:0 18px;
  font-size:9.5px !important;
  line-height:1;
  background:transparent !important;
  border-bottom:1px solid rgba(42,47,58,.7) !important;
  color:rgba(255,255,255,.78) !important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  vertical-align:middle;
  font-variant-numeric:tabular-nums;
  font-weight:400;
  transition:background var(--plt-ease), color var(--plt-ease);
}
.plt-table tbody td:first-child{
  font-weight:600;
  color:rgba(255,255,255,.92) !important;
}
.plt-table tbody tr:nth-child(even) td{background:rgba(255,255,255,.015) !important}
.plt-table tbody tr:hover td{background:rgba(214,176,77,.07) !important}

/* Best month — green text row */
.plt-table tbody tr.is-best td,
.plt-table tbody tr.is-best td.plt-num,
.plt-table tbody tr.is-best .is-neg,
.plt-table tbody tr.is-best .is-pos{
  color:var(--plt-pos) !important;
  background:rgba(98,210,111,.04) !important;
  font-weight:600;
}

/* Current month — gold outline */
.plt-table tbody tr.is-current td{
  background:rgba(214,176,77,.05) !important;
  border-top:1px solid rgba(214,176,77,.7) !important;
  border-bottom:1px solid rgba(214,176,77,.7) !important;
}
.plt-table tbody tr.is-current td:first-child{
  border-left:2px solid var(--plt-gold) !important;
  border-radius:6px 0 0 6px;
  box-shadow:inset 3px 0 0 rgba(214,176,77,.35);
}
.plt-table tbody tr.is-current td:last-child{
  border-right:1px solid rgba(214,176,77,.7) !important;
  border-radius:0 6px 6px 0;
}

/* Current + loss */
.plt-table tbody tr.is-current.is-loss td,
.plt-table tbody tr.is-current.is-loss td.plt-num,
.plt-table tbody tr.is-current.is-loss .is-neg,
.plt-table tbody tr.is-current.is-loss .is-pos{
  color:#E67A4A !important;
}
.plt-table tbody tr.is-current.is-loss .is-neg{color:var(--plt-neg) !important}

.plt-table .is-neg{color:var(--plt-neg) !important}
.plt-table .is-pos{color:var(--plt-pos) !important}

.plt-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:16px;
  min-width:46px;
  padding:0 7px;
  border-radius:999px;
  font-size:9px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  letter-spacing:.01em;
}
.plt-badge.is-pos{
  color:var(--plt-pos);
  background:rgba(98,210,111,.12);
  border:1px solid rgba(98,210,111,.28);
}
.plt-badge.is-neg{
  color:var(--plt-neg);
  background:rgba(228,93,93,.12);
  border:1px solid rgba(228,93,93,.28);
}
.plt-badge.is-muted{
  color:var(--plt-muted);
  background:rgba(255,255,255,.04);
  border:1px solid var(--plt-border);
}

.plt-loading,
.plt-denied,
.plt-empty{
  padding:28px 20px;
  text-align:center;
  color:var(--plt-muted);
  font-size:13px;
}

/* ---------- Responsive ---------- */
/* Tall screens (1080+): roomier rows and charts */
@media (min-height:900px){
  .plt-head{min-height:48px}
  .plt-title{font-size:20px}
  .plt-kpi{height:96px;padding:13px 16px}
  .plt-kpi-val{font-size:clamp(20px,1.5vw,25px)}
  .plt-kpi-hint,.plt-kpi-top{font-size:11.5px}
  .plt-charts{max-height:420px}
  .plt-table tbody td{height:34px;font-size:10.5px !important}
  .plt-table thead th{height:36px;font-size:10px}
  .plt-badge{height:20px;font-size:11px}
}

/* Short screens: allow page scroll as a safety net */
@media (max-height:620px){
  #app.theme-dashboard-pro.view-finance.view-pltrend #content{overflow:auto !important}
  .plt-page,.plt-body{overflow:visible;flex:0 0 auto}
  .plt-charts{min-height:200px;max-height:240px;flex:0 0 auto}
  .plt-table-wrap{max-height:300px}
}

/* <=1280: stack, page scrolls */
@media (max-width:1280px){
  #app.theme-dashboard-pro.view-finance.view-pltrend #content{overflow:auto !important}
  .plt-page,.plt-body{overflow:visible;flex:0 0 auto}
  .plt-head{flex-direction:column;align-items:stretch;gap:8px;min-height:0}
  .plt-toolbar{justify-content:flex-start;flex-wrap:wrap}
  .plt-kpis{grid-template-columns:1fr 1fr}
  .plt-charts{grid-template-columns:1fr;max-height:none;min-height:0;flex:0 0 auto}
  .plt-chart-main,.plt-chart-side{height:240px}
  .plt-table-panel{flex:0 0 auto}
  .plt-table-wrap{max-height:340px}
}
@media (max-width:900px){
  .plt-kpis{grid-template-columns:1fr}
  .plt-toolbar{flex-direction:column;align-items:stretch}
  .plt-filter,.plt-btn{width:100%;flex:1 1 auto}
  .plt-title{white-space:normal}
  .plt-table thead th,
  .plt-table tbody td{padding:0 8px}
}
