/* BEGOS Finans — final UX turu.
   Hedef: masaüstünde tek bakışta tüm dashboard; kartlar ne sıkışık ne de gereksiz yayvan. */

/* DASHBOARD ------------------------------------------------------------ */
.dashboard-reference{
  width:100%!important;
  max-width:1580px!important;
  margin:0 auto!important;
  padding-bottom:8px!important;
}
.dashboard-reference .dashboard-ref-head{margin-bottom:14px!important}
.dashboard-reference .dashboard-ref-title h1{font-size:clamp(35px,2.05vw,42px)!important}
.dashboard-reference .dashboard-ref-title p{font-size:14px!important}

/* Üst alan: tek güçlü bakiye kartı + 5 KPI, geniş ekranda iki satırda dengeli. */
.dashboard-ref-hero{
  grid-template-columns:minmax(430px,1.02fr) minmax(0,2.12fr)!important;
  gap:14px!important;
  margin-bottom:16px!important;
  align-items:stretch!important;
}
.ref-main-balance{min-height:214px!important;padding:23px 24px!important}
.ref-main-icon{width:46px!important;height:46px!important;margin-bottom:9px!important}
.ref-main-balance>span{font-size:16px!important}
.ref-main-balance>strong{font-size:clamp(39px,2.3vw,47px)!important}
.ref-main-balance>p{font-size:12px!important}
.ref-main-balance .ref-main-foot{padding-top:10px!important;font-size:11px!important}
.ref-main-balance .ref-main-foot b{font-size:14px!important}

.ref-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important}
.ref-kpi{min-height:104px!important;padding:14px 15px!important;grid-template-columns:45px minmax(0,1fr)!important;gap:11px!important;border-radius:14px!important}
.ref-kpi-icon{width:44px!important;height:44px!important;border-radius:11px!important}
.ref-kpi-icon svg{width:22px!important;height:22px!important}
.ref-kpi-content>span{font-size:11px!important}
.ref-kpi-content>strong{font-size:clamp(20px,1.22vw,24px)!important}
.ref-kpi-content>small{font-size:10px!important;margin-top:5px!important}

/* 7 günlük akış tekrar tek satır: dashboard yüksekliğini şişirmeden okunabilir. */
.ref-section-head{margin-top:0!important;margin-bottom:8px!important}
.ref-section-head .eyebrow{font-size:10px!important}
.ref-section-head h2{font-size:21px!important}
.ref-section-head>a{font-size:12px!important}
.ref-cashflow{grid-template-columns:repeat(6,minmax(0,1fr))!important;border-radius:15px!important}
.ref-flow{min-height:90px!important;padding:12px 14px!important;border-bottom:0!important;border-right:1px solid #edf1f5!important}
.ref-flow:last-child{border-right:0!important}
.ref-flow:nth-child(3n){border-right:1px solid #edf1f5!important}
.ref-flow span{font-size:10px!important}
.ref-flow strong{font-size:17px!important}
.ref-flow small{font-size:9px!important}
.ref-flow-top{margin-bottom:5px!important;gap:7px!important}
.ref-flow-icon{width:31px!important;height:31px!important}
.ref-flow-icon svg{width:16px!important;height:16px!important}
.ref-projection-note{margin-top:6px!important;padding:7px 10px!important;font-size:10px!important}

/* Alt alan 3 kolon. Alacak Özeti artık tüm sayfaya yayılmaz. */
.ref-bottom-grid{
  grid-template-columns:minmax(0,1.34fr) minmax(290px,.72fr) minmax(330px,.86fr)!important;
  gap:12px!important;
  margin-top:12px!important;
  align-items:stretch!important;
}
.ref-bottom-grid>.ref-panel:nth-child(3){grid-column:auto!important}
.ref-panel{min-width:0!important}
.ref-liquidity{min-height:258px!important;padding:15px 16px 13px!important}
.ref-liquidity h2{font-size:25px!important}
.ref-liquidity h3{font-size:14px!important}
.ref-coverage span{font-size:10px!important}.ref-coverage strong{font-size:24px!important}
.ref-liquidity-message{margin:8px 0 0!important;font-size:11px!important}
.ref-sparkline{height:67px!important;margin-top:0!important}
.ref-health-note{padding:9px 10px!important;margin-top:0!important}
.ref-health-note strong{font-size:9.5px!important}
.ref-health-note span{font-size:8.5px!important}
.ref-card-head{padding:12px 13px!important}
.ref-card-head h2{font-size:15px!important}.ref-card-head a{font-size:10px!important}
.ref-agenda-row{padding:9px 12px!important;grid-template-columns:32px minmax(0,1fr) auto 9px!important}
.ref-agenda-badge{width:31px!important;height:26px!important}
.ref-agenda-copy small{font-size:9px!important}.ref-agenda-copy strong,.ref-agenda-amount{font-size:10.5px!important}
.ref-receivable-head-row,.ref-receivable-row{
  grid-template-columns:minmax(0,1fr) 82px 104px!important;
  gap:7px!important;
  padding-left:12px!important;
  padding-right:12px!important;
}
.ref-receivable-head-row{padding-top:7px!important;padding-bottom:7px!important;font-size:9px!important}
.ref-receivable-row{padding-top:9px!important;padding-bottom:9px!important}
.ref-receivable-row .name{font-size:9.5px!important;line-height:1.28!important}
.ref-receivable-row .date{font-size:8.5px!important}
.ref-receivable-row .amount{font-size:9.5px!important}
.ref-receivable-footer{margin:7px 10px 10px!important;padding:8px!important;font-size:10px!important}
.dashboard-ref-footer{margin-top:8px!important;font-size:9px!important}

/* Sortable tables: tüm faydalı kolonlarda tek tıkla artan/azalan sıralama. */
.sortable-table th.sortable-header{cursor:pointer;user-select:none;position:relative;padding-right:26px!important;transition:background .15s ease,color .15s ease}
.sortable-table th.sortable-header:hover{background:#eef4fb!important;color:#203a5d!important}
.sortable-table th.sortable-header:after{content:"↕";position:absolute;right:9px;top:50%;transform:translateY(-50%);font-size:11px;color:#a0adbc;font-weight:700}
.sortable-table th.sortable-header[aria-sort="ascending"]:after{content:"↑";color:#1c65bd}
.sortable-table th.sortable-header[aria-sort="descending"]:after{content:"↓";color:#1c65bd}
.sortable-table th.sortable-header:focus-visible{outline:2px solid #7aa8e8;outline-offset:-2px}
.sortable-table th.no-sort{cursor:default}

/* Veri güncelliği / snapshot küçük aksiyon satırı. */
.dashboard-data-strip{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-top:10px;padding:9px 12px;border:1px solid #e4eaf1;border-radius:11px;background:rgba(255,255,255,.72);font-size:10px;color:#6c7d92}
.dashboard-data-strip .freshness{display:flex;gap:14px;flex-wrap:wrap}.dashboard-data-strip strong{color:#263d5a}.dashboard-data-strip form{margin:0}.dashboard-data-strip button{padding:7px 10px!important;font-size:10px!important;border-radius:8px!important}
.snapshot-success{margin-top:8px;padding:8px 11px;border-radius:9px;background:#edf9f2;border:1px solid #c6ead5;color:#187448;font-size:10px;font-weight:700}

/* 1080p / büyük masaüstünde tüm kontrol merkezi tek ekranda kalacak şekilde ince ayar. */
@media (min-width:1500px) and (min-height:820px){
  .app-content.container{padding-top:22px!important;padding-bottom:20px!important}
  .dashboard-reference .dashboard-ref-head{margin-bottom:11px!important}
  .dashboard-ref-hero{margin-bottom:12px!important}
  .ref-bottom-grid{margin-top:10px!important}
  .dashboard-ref-footer{margin-top:5px!important}
}

/* CALENDAR ------------------------------------------------------------- */
/* Takvim yalnız POS, DBS ve ödemeyi gösterir. */
.calendar-kpis-three{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.calendar-kpi.dbs{border-left:4px solid #12a36b!important}
.dot.dbs{background:#12a36b!important}
.calendar-event-v2.dbs{background:#eaf9f0!important;color:#147a49!important}
.day-event-card.dbs{border-color:#12a36b!important;background:#f3fbf6!important}
.calendar-layout{grid-template-columns:minmax(0,1.62fr) minmax(330px,.48fr)!important;gap:18px!important}
.calendar-day-v2{min-height:138px!important;padding:10px!important}
.calendar-event-v2{padding:7px 8px!important}
.calendar-event-v2 span{font-size:9px!important}.calendar-event-v2 strong{font-size:10px!important}
.day-detail-panel{top:24px!important}

/* USER MANAGEMENT ------------------------------------------------------ */
.user-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.current-user-label{display:inline-block;margin-left:9px;font-size:9px;color:#67788e;background:#eef2f7;border-radius:999px;padding:4px 7px}
.user-edit-card{max-width:900px;padding:24px}
.user-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.user-form-grid .form-field{display:grid;gap:7px}
.user-form-grid label{font-weight:750;color:#263951}
.user-form-grid input,.user-form-grid select{width:100%;padding:12px 13px;border:1px solid #d4dce7;border-radius:10px;background:#fff;font:inherit}
.user-form-grid small{color:#8190a3;font-size:10px}
.user-active-toggle{display:flex!important;align-items:center!important;gap:10px!important;padding:12px 14px;border:1px solid #e2e8ef;border-radius:11px;background:#f8fafc}
.user-active-toggle input{width:auto!important}
.user-active-toggle span{display:grid;gap:2px}.user-active-toggle strong{font-size:12px}.user-active-toggle small{font-size:10px;color:#8190a3}
.user-form-actions{margin-top:20px}

/* RECEIVABLES ---------------------------------------------------------- */
.receivables-page .page-v2-head{align-items:center!important}

/* OFFICE / SMALLER DESKTOP -------------------------------------------- */
@media(max-width:1499px){
  .dashboard-reference{max-width:none!important}
  .dashboard-ref-hero{grid-template-columns:1fr!important}
  .ref-main-balance{min-height:205px!important}
  .ref-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .ref-cashflow{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .ref-flow{border-bottom:1px solid #edf1f5!important}
  .ref-flow:nth-child(3n){border-right:0!important}
  .ref-flow:nth-last-child(-n+3){border-bottom:0!important}
  .ref-bottom-grid{grid-template-columns:1fr 1fr!important}
  .ref-bottom-grid>.ref-panel:nth-child(3){grid-column:1/-1!important}
  .calendar-layout{grid-template-columns:1fr!important}.day-detail-panel{position:static!important;order:-1}
}
@media(max-width:1050px){
  .ref-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .ref-cashflow{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .ref-flow:nth-child(3n){border-right:1px solid #edf1f5!important}.ref-flow:nth-child(2n){border-right:0!important}
  .ref-flow:nth-last-child(-n+3){border-bottom:1px solid #edf1f5!important}.ref-flow:nth-last-child(-n+2){border-bottom:0!important}
  .ref-bottom-grid{grid-template-columns:1fr!important}.ref-bottom-grid>.ref-panel:nth-child(3){grid-column:auto!important}
  .calendar-kpis-three,.user-kpis{grid-template-columns:1fr!important}
}
@media(max-width:700px){
  .ref-kpi-grid,.ref-cashflow,.user-form-grid{grid-template-columns:1fr!important}
  .ref-flow{border-right:0!important;border-bottom:1px solid #edf1f5!important}.ref-flow:last-child{border-bottom:0!important}
}

/* Mali Durum yazdırma: içerik dışında hiçbir şey ikinci sayfa üretmez. */
@media print{
  @page{size:A4 portrait;margin:7mm 9mm}
  html,body,.app-body,.app-shell,.app-workspace,.app-content.container{height:auto!important;min-height:0!important;overflow:visible!important;background:#fff!important}
  .app-sidebar,.mobile-topbar,.app-workspace:before,.no-print{display:none!important}
  .app-shell{display:block!important}
  .app-workspace{display:block!important}
  .app-content.container{display:block!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important}
  .cash-position-page{display:block!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;break-after:avoid-page!important;page-break-after:avoid!important}
  .cash-position-page .cash-report{width:100%!important;max-width:none!important;margin:0!important;padding:0!important;box-shadow:none!important;border:0!important;break-inside:avoid!important;page-break-inside:avoid!important;break-after:avoid-page!important;page-break-after:avoid!important}
  .cash-position-page .cash-report-title{margin:0 0 14px!important;padding:0!important}
  .cash-position-page .cash-report-title strong{font-size:18px!important}
  .cash-position-page .cash-report-title span{font-size:14px!important}
  .cash-position-page .cash-report-group{margin:0 0 11px!important;break-inside:avoid!important;page-break-inside:avoid!important}
  .cash-position-page .cash-report-group-head{padding:7px 0!important;font-size:13px!important}
  .cash-position-page .cash-report-line{padding:7px 0!important}
  .cash-position-page .cash-report-row{font-size:12px!important}
  .cash-position-page .cash-report-detail,.cash-position-page .cash-report-empty{font-size:10px!important;line-height:1.3!important}
  .cash-position-page .cash-report-total{margin-top:12px!important;padding-top:11px!important;font-size:14px!important;break-inside:avoid!important;page-break-inside:avoid!important}
}
