/* Çeşitlere Göre Toplam tablosunu sığdır ve responsive yap */
.repMatrixWrap {
  overflow-x: auto;
}
.repMatrixTbl {
  font-size: 12px;
  min-width: 520px;
  word-break: keep-all;
}
.repMatrixTbl th, .repMatrixTbl td {
  padding: 4px 6px;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .repMatrixTbl {
    font-size: 11px;
    min-width: 420px;
  }
}

/* Çeşitlere Göre Toplam kartını daha geniş yap */
.grid2 > .card.inner {
  width: 100%;
  max-width: 650px;
  box-sizing: border-box;
}
/* Çeşitlere Göre Toplam kartını Günlük Ödeme Özeti altına kadar uzat */
.grid2 {
  align-items: stretch;
}
.grid2 > .card.inner {
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
/* Çeşitlere Göre Toplam kartını Günlük Ödeme Özeti kadar büyüt */
.grid2 > .card.inner {
  width: 100%;
  box-sizing: border-box;
}
:root{
  --bg:#ffffff;
  --card:#ffffff;
  --text:#111111;
  --muted:#555555;
  --line:#dddddd;
  --btn:#111111;
  --btn2:#f2f2f2;
  --green:#0a7a3b;
  --red:#b42318;
}

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);overflow:auto;}
body.modal-open{overflow:hidden;}
body.device-tablet{font-size:14px;}
body.device-tablet .homeCols{grid-template-columns:1fr;}
body.device-tablet .sidebar{flex-wrap:wrap;position:sticky;top:0;background:#fff;z-index:40;}
body.device-tablet .sideBtn{flex:1 0 calc(50% - 8px);text-align:center;}
body.device-mobile{font-size:15px;background:#f8fafc;}
body.device-mobile .authOverlay{padding:0;}
body.device-mobile .authCard{width:100%;max-width:none;border-radius:0;min-height:100vh;box-shadow:none;border:0;padding:20px 18px;}
body.device-mobile .waContact a{width:100%;justify-content:center;}
body.device-mobile .trialSignupBox{border-radius:0;border-left:0;border-right:0;}
body.device-mobile .layout{display:block;min-height:auto;}
body.device-mobile .sidebar{position:sticky;top:0;width:auto;height:auto;border-right:0;border-bottom:1px solid var(--line);display:flex;flex-wrap:nowrap;gap:10px;overflow-x:auto;padding:12px;background:#fff;z-index:50;box-shadow:0 6px 20px rgba(15,23,42,0.08);} 
body.device-mobile .sideBtn{flex:0 0 auto;min-width:140px;text-align:center;margin:0;font-size:14px;}
body.device-mobile .sideBtn.active{background:#111;color:#fff;}
body.device-mobile .content{padding-top:10px;}
body.device-mobile .wrap{padding:0 8px;}
body.device-mobile .card{padding:12px;border-radius:14px;}
body.device-mobile .row{flex-direction:column;align-items:stretch;gap:10px;}
body.device-mobile .row.wrap input,
body.device-mobile .row.wrap select,
body.device-mobile .row.wrap button,
body.device-mobile .row.wrap .payWrap{flex:1 1 100%;min-width:100%;}
body.device-mobile input,
body.device-mobile select{font-size:15px;padding:11px 12px;}
body.device-mobile .btn{font-size:15px;padding:11px 12px;width:100%;}
body.device-mobile .payWrap{flex-direction:column;align-items:stretch;}
body.device-mobile .payBtn{width:100%;}
body.device-mobile .homeCols{display:block;}
body.device-mobile .homeCol{gap:12px;}
body.device-mobile .tableWrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
body.device-mobile .authBody{gap:12px;}
body.device-mobile #trialSignupForm{gap:10px;}
body.device-mobile #sellerCard .row.wrap{flex-direction:column;}

/* ===== Giriş ekranı (Auth Overlay) ===== */
.authOverlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:10000;
}
.authOverlay[aria-hidden="true"]{display:none;}
.authCard{
  width:min(440px, 100%);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 18px 44px rgba(0,0,0,.18);
  padding:14px;
}
.authHead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;}
.authTitle{font-weight:900;font-size:16px;}
.authBody{display:flex;flex-direction:column;gap:10px;}
body.authLocked{overflow:hidden;}
#appRoot.appHidden{display:none !important;}


/* WhatsApp iletişim (Giriş ekranı altı) */
.waContact{display:flex;justify-content:center;margin-top:6px;}
.waContact a{
  display:flex;align-items:center;gap:8px;
  text-decoration:none;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--card);
  color:var(--text);
  font-weight:700;
}
.waContact a:hover{filter:brightness(0.98);}
.waSvg{width:18px;height:18px;fill:currentColor;opacity:.9;}
.authDivider{height:1px;background:var(--line);margin:14px 0;}
.trialSignupBox{display:flex;flex-direction:column;gap:6px;background:#f8fafc;border:1px dashed var(--line);border-radius:12px;padding:10px;}
.trialSignupBox h4{margin:0;font-size:14px;}
.trialSignupBox input{background:#fff;}
.trialSignupBox .btn{width:100%;}
.trialLock{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  text-align:center;
  padding:18px;
  border-radius:inherit;
  background:rgba(15,23,42,0.92);
  color:#fff;
  font-weight:800;
  font-size:13px;
  line-height:1.5;
  z-index:40;
  pointer-events:auto;
}
.trialLock .trialWaLink{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#25d366;
  color:#0f172a;
  font-weight:800;
  font-size:12px;
  text-decoration:none;
  border:1px solid rgba(15,23,42,0.2);
  box-shadow:0 6px 16px rgba(37,211,102,0.3);
}
.trialLock .trialWaLink svg{
  width:15px;
  height:15px;
  fill:currentColor;
}
.card.trialBlocked > :not(.trialLock){
  pointer-events:none;
  user-select:none;
  opacity:0.35;
  filter:grayscale(0.4);
}

/* ===== Sol Menü ===== */
.layout{display:flex;min-height:100vh}
.sidebar{
  width:150px;
flex:0 0 150px;
padding:14px 12px;
  border-right:1px solid var(--line);
  background:#fff;
  position:sticky;
  top:0;
  height:100vh;
}
.sideTitle{font-weight:900;font-size:14px;margin:4px 0 10px}
.sideBtn{
  width:100%;
  text-align:left;
  border:1px solid var(--line);
  background:#fff;
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
  font-weight:800;
  font-size:13px;
  margin-bottom:8px;
}
.sideBtn.active{background:#f6f6f6}
.sideBtn:hover{background:#fafafa}
.sideBtn:disabled{opacity:0.45;cursor:not-allowed;background:#fdfdfd;color:#a1a1aa;border-style:dashed;}

/* ===== Menü daraltma (Sadece "Kayıt Ekranı" görünsün) ===== */
.sidebar .sideTitle{display:none;}
.sidebar .sideBtn{white-space:nowrap;}
/* Nav'da Giderler ve Kayıt butonlarını da görünür yap */
.sidebar .sideBtn:not(#navHome):not(#navRecords):not(#navExpenses):not(#navRegister):not(#navSettings){display:none;}
.content{flex:1;min-width:0}

/* Sayfa filtreleme */
.pageHidden{display:none !important}

@media (max-width: 980px){
  .layout{display:block}
  .sidebar{
    position:static;
    width:auto;
    height:auto;
    border-right:0;
    border-bottom:1px solid var(--line);
    display:flex;
    gap:8px;
    overflow:auto;
    white-space:nowrap;
  }
  .sideTitle{display:none}
  .sideBtn{margin:0;flex:0 0 auto}
}

.wrap{max-width:1700px;margin:8px auto;padding:0 10px; padding-top:8px}
.card{position:relative;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:8px;box-shadow:0 6px 14px rgba(0,0,0,.05);}
.card.inner{border-radius:12px;padding:8px;box-shadow:none}

h1{margin:0;font-size:20px}
h2{margin:0 0 6px;font-size:14px}
.h3{margin:8px 0 6px;font-size:13px}

.muted{color:var(--muted)}
.small{font-size:12px}
.center{text-align:center}
.full{width:100%}

.row{display:flex;gap:8px;align-items:center;justify-content:space-between}
.row.wrap{flex-wrap:wrap}
.mainFlow{margin-top:8px;display:block;}

/* HOME: 2 parça (Satıcı+Hesaplama) | (Teslim+Gün Sonu) */
.homeCols{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:start}
.homeCols[data-page="expenses"]{grid-template-columns:1fr}
.homeCol{display:flex;flex-direction:column;gap:10px}
@media (max-width: 900px){
  .homeCols{grid-template-columns:1fr;}
}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
@media (max-width:980px){.grid2{grid-template-columns:1fr}}

input,select{width:100%;border-radius:12px;font-size:13px;border:1px solid var(--line);background:#fff;color:var(--text);padding:7px 9px;outline:none;font-size:12.5px}
.row.wrap input,.row.wrap select{flex:1;min-width:160px}

.btn{border:0;border-radius:12px;padding:7px 9px;background:var(--btn);color:#fff;cursor:pointer;font-weight:700;white-space:nowrap;font-size:12.5px}
.btn.ghost{background:var(--btn2);border:1px solid var(--line);color:var(--text)}
.btn.danger{background:var(--red)}
.btn:hover{filter:brightness(1.02)}
.btn:disabled{opacity:0.55;cursor:not-allowed;filter:none}
.linkBtn{border:0;background:transparent;color:var(--green);font-weight:800;cursor:pointer;font-size:12px;padding:0 4px;line-height:1.4;white-space:nowrap}
.linkBtn:disabled{opacity:0.5;cursor:not-allowed}
.shareBtn{display:inline-flex;align-items:center;justify-content:center;border:0;background:var(--btn2);color:var(--text);padding:6px;border-radius:12px;cursor:pointer;font-size:12px;border:1px solid var(--line)}
.shareBtn svg{width:18px;height:18px;fill:currentColor}
.shareBtn.iconOnly{width:36px;height:36px;padding:0}
.shareBtn:disabled{opacity:0.55;cursor:not-allowed}
.summaryShareRow{display:flex;justify-content:flex-end;gap:6px;margin-bottom:6px}
.detailShareRow{margin-top:6px}
.summaryField{display:flex;flex-direction:column;gap:2px;min-width:180px}
.summaryLabel{display:inline-flex;align-items:center;gap:4px}
.summaryLabel svg{width:14px;height:14px;fill:currentColor;opacity:0.7}
.userActions{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap}
.userActions .btn{padding:5px 10px;font-size:12px}
.userActions .trash{margin:0}
.giderMain{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:18px;align-items:flex-start;margin-bottom:16px}
.giderSectionCard{border:1px solid #e2e8f0;border-radius:18px;padding:18px;background:#fff;min-width:0;display:flex;flex-direction:column;gap:16px;position:relative}
.giderLedgerCard{gap:18px}
.giderLedgerDivider{height:1px;background:var(--line);opacity:0.6;margin:4px 0}
.giderLedgerCard .giderTableCard{margin-top:0}
.giderLedgerCard .giderTableCard .tbl{min-width:100%}
.giderColumn{min-width:0}
.kasalarColumn{min-width:0}
.fireColumn{min-width:0}
.fireColumn .fireBox{margin-top:0;padding:18px;background:#f8fafc;border-radius:18px;border:1px solid #e2e8f0;display:flex;flex-direction:column;gap:16px;height:100%}
@media (max-width:640px){
  .giderMain{grid-template-columns:1fr}
}
@media (min-width:900px){
  .giderMain{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(120px,auto)}
}
.cardMiniHead{display:flex;flex-direction:column;gap:4px}
.giderLedgerTop{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;flex-wrap:wrap}
.giderSaveBtn{align-self:flex-start;padding:8px 14px;font-size:12px;min-width:unset}
.giderForm{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-bottom:8px}
.giderField{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#475569;font-weight:600}
.giderField input{padding:10px 12px;border:1px solid #d5dfee;border-radius:10px;font-size:14px;background:#fff}
.giderField.flex{grid-column:span 2;min-width:220px}
@media(max-width:640px){.giderField.flex{grid-column:span 1}}
.giderLedgerCard #giderMesaj{min-height:18px}
.giderTableCard{border:1px solid #e2e8f0;border-radius:14px;margin-top:4px;padding:4px;background:#fff}
.giderListStats{display:flex;gap:14px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:12px;margin-top:4px}
.giderListStat{flex:1;min-width:180px;display:flex;flex-direction:column;gap:4px;font-size:12px;color:#475569}
.giderListStat p{margin:0;font-weight:700;color:#0f172a;font-size:13px}
.giderListStat strong{font-size:16px;color:#0f172a}
.giderListStat span{font-size:12px;color:#475569}
.kasalarColumn{gap:14px}
.kasalarColumn h3{font-size:13px;margin:0}
.kasalarForm{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin-bottom:6px}
.kasalarForm label{display:flex;flex-direction:column;font-size:12px;color:#475569;font-weight:600;gap:6px}
.kasalarForm label input{padding:10px 12px;border:1px solid #d5dfee;border-radius:10px;font-size:12.5px}
.kasalarForm label.flex{grid-column:span 2;min-width:220px}
@media(max-width:640px){.kasalarForm label.flex{grid-column:span 1}}
.kasalarForm .btn{grid-column:span 2;justify-self:flex-start;font-size:12.5px;padding:8px 10px}
@media(max-width:640px){.kasalarForm .btn{grid-column:span 1;width:100%}}
.kasalarColumn .tableWrap{margin-top:0}
.kasalarColumn .tbl{font-size:12.5px}
.kasalarColumn #adetMesaj{font-size:12px;color:#475569}
.fireBox{margin-top:16px;padding:16px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc}
.fireBoxHead{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}
.fireBoxHead h3{margin:0}
.fireControls{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.fireControls label{display:flex;flex-direction:column;font-size:13px;gap:4px;min-width:160px}
.fireControls input{padding:8px 10px;border:1px solid #cbd5f5;border-radius:8px;background:#fff;font-size:14px}
.fireControls .fireSelectField{min-width:200px}
.fireControls select{padding:8px 10px;border:1px solid #cbd5f5;border-radius:8px;background:#fff;font-size:14px}
.fireStats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-bottom:12px}
.fireStat{border:1px solid #e2e8f0;border-radius:12px;padding:12px;background:#fff;display:flex;flex-direction:column;gap:6px}
.fireStat span{font-size:12px;color:#64748b}
.fireStat b{font-size:13px;font-weight:700;color:#0f172a}
.fireStat input{padding:8px 10px;border:1px solid #cbd5f5;border-radius:8px;font-size:16px}
.fireDiff{font-size:13px;font-weight:700;color:#0f172a}
.fireDiff.positive{color:#16a34a}
.fireDiff.negative{color:#dc2626}
.fireTypeBreakdown{margin-top:8px;display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:6px}
.fireTypeBreakdown .fireTypeItem{border:1px solid var(--line);border-radius:10px;padding:6px 8px;background:#fff;display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#475569;cursor:pointer;transition:background .15s ease,border-color .15s ease,color .15s ease}
.fireTypeBreakdown .fireTypeItem strong{font-size:11px;color:#0f172a}
.fireTypeBreakdown .fireTypeItem span{font-weight:600;font-variant-numeric:tabular-nums}
.fireTypeBreakdown .fireTypeItem.active{background:#0f172a;color:#fff;border-color:#0f172a}
.fireTypeBreakdown .fireTypeItem.active strong,.fireTypeBreakdown .fireTypeItem.active span{color:#fff}
.fireTypeBreakdown .fireTypeEmpty{padding:8px;border:1px dashed var(--line);border-radius:10px;font-size:11px;color:#94a3b8;text-align:center}
.fireActions{display:flex;align-items:center;gap:12px;margin-bottom:8px}
.fireTableWrap .trash{margin:0}

.sellerDetailOverlay{position:fixed;inset:0;background:rgba(15,23,42,0.6);display:none;align-items:flex-start;justify-content:center;padding:30px 16px;z-index:12000;overflow:auto;backdrop-filter:blur(2px);}
.sellerDetailOverlay.open{display:flex;}
.sellerDetailCard{width:min(920px,100%);background:#fff;border-radius:18px;padding:18px;border:1px solid var(--line);box-shadow:0 30px 80px rgba(15,23,42,0.25);display:flex;flex-direction:column;gap:14px;max-height:calc(100vh - 60px);overflow:auto;}
.sellerDetailHead{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.sellerDetailTitle{font-weight:800;font-size:18px;margin-bottom:4px}
.sellerDetailFilters{display:flex;gap:12px;flex-wrap:wrap}
.sellerDetailFilters label{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:600;color:var(--muted)}
.sellerDetailFilters input{min-width:180px}
.sellerDetailStats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px}
.sellerDetailStats>div{border:1px solid var(--line);border-radius:12px;padding:10px;background:#f9fafb;display:flex;flex-direction:column;gap:4px}
.sellerDetailSection{display:flex;flex-direction:column;gap:6px}
.sectionTitle{font-weight:800;font-size:14px}
.sellerDetailCard .tableWrap{margin-top:0}

@media (max-width:640px){
  .sellerDetailCard{padding:16px;}
  .sellerDetailFilters input{min-width:140px}
}

.pill{padding:6px 10px;border-radius:999px;border:1px solid var(--line);background:#fff;min-width:64px;text-align:center;font-variant-numeric:tabular-nums;}
.paidInput{min-width:160px}
.infoPill{min-width:auto}

.payWrap{display:flex;gap:8px;align-items:center;flex:0 0 auto}
.payBtn{border:1px solid var(--line);background:#fff;padding:7px 9px;border-radius:12px;cursor:pointer;font-weight:800;white-space:nowrap;font-size:12.5px}
.payBtn.paid{border-color:rgba(10,122,59,.35)}
.payBtn.unpaid{border-color:rgba(180,35,24,.35)}
.payBtn.active.paid{background:rgba(10,122,59,.10);border-color:var(--green)}
.payBtn.active.unpaid{background:rgba(180,35,24,.10);border-color:var(--red)}

.tableWrap{overflow:auto;margin-top:6px;border-radius:12px;border:1px solid var(--line)}
.tbl{width:100%;border-collapse:collapse;background:#fff;font-size:12.5px}
.tbl th,.tbl td{padding:6px 8px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}
.tbl th{background:#fafafa}
.tbl .r{text-align:right}
.tbl .c{text-align:center}
.tbl .group{background:#f6f6f6;font-weight:900}

.tbl.calc input.mini{width:78px;padding:6px 7px;border-radius:10px;text-align:center}
.tbl.calc td:nth-child(3), .tbl.calc th:nth-child(3){width:28px}
.tbl.calc td:nth-child(5), .tbl.calc th:nth-child(5){width:28px;font-weight:800}
.tbl.calc .result{display:inline-block;min-width:80px;font-variant-numeric:tabular-nums}
.tbl.calc tfoot th{background:#fafafa}
.tbl.calc tfoot tr:nth-child(2) th{font-weight:800}

.badge{display:inline-block;padding:5px 9px;border-radius:999px;font-weight:800;border:1px solid var(--line);font-size:12px}
.badge.paid{color:var(--green);border-color:rgba(10,122,59,.35);background:rgba(10,122,59,.08)}
.badge.unpaid{color:var(--red);border-color:rgba(180,35,24,.35);background:rgba(180,35,24,.08)}
.badge.partial{color:#8a6d00;border-color:rgba(138,109,0,.35);background:rgba(138,109,0,.08)}
.registerBackupList{display:flex;flex-direction:column;gap:10px}
.registerBackupList .muted{font-size:0.9rem}
.backupRow{border:1px solid rgba(15,23,42,0.08);border-radius:12px;padding:12px;background:#fff;display:flex;flex-direction:column;gap:6px}
.backupHead{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:0.9rem;color:#475569}
.backupHead b{color:#0f172a;font-size:1rem}
.backupBody{font-size:0.95rem;color:#0f172a}
.backupRow .badge{align-self:flex-start}

/* WhatsApp deneme checklisti */
#waChecklistCard{display:flex;flex-direction:column;gap:10px}
.waChecklistForm{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}
.waChecklistForm .btn{grid-column:1 / -1}
@media(max-width:640px){.waChecklistForm .btn{width:100%}}
.waChecklistSummary{font-weight:700;font-size:12px;color:#0f172a;background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:8px 10px}
.waRequestsTable .muted{font-size:11px}
.waRequestsEmpty{padding:14px}
.waActionGroup{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:6px}
.waActionGroup .linkBtn{padding:0 6px}
.badge.pending{color:#92400e;border-color:rgba(146,64,14,.35);background:rgba(146,64,14,.08)}
.badge.approved{color:var(--green);border-color:rgba(10,122,59,.35);background:rgba(10,122,59,.08)}
.badge.rejected{color:var(--red);border-color:rgba(180,35,24,.35);background:rgba(180,35,24,.08)}

tr.row-paid{background:rgba(10,122,59,.06)}
tr.row-unpaid{background:rgba(180,35,24,.06)}
tr.row-partial{background:rgba(138,109,0,.06)}

.trash{background:transparent;border:1px solid var(--line);color:var(--text);border-radius:10px;padding:6px 9px;cursor:pointer;white-space:nowrap;font-size:12px}
.trash:hover{background:#fafafa}

/* Satıcı öneri */
.field{position:relative;flex:1;min-width:220px}
.suggest{position:absolute;left:0;right:0;top:calc(100% + 6px);background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 22px rgba(0,0,0,.08);max-height:240px;overflow:auto;z-index:20}
.suggest.hidden{display:none}
.suggest .item{padding:8px 10px;border-bottom:1px solid var(--line);cursor:pointer;font-size:13px}
.suggest .item:last-child{border-bottom:0}
.suggest .item:hover{background:#fafafa}
.suggest .head{padding:9px 12px;font-weight:900;background:#fafafa;border-bottom:1px solid var(--line);font-size:12px}

/* Sabit saat/tarih paneli (sağ üst) */
.clockPanel{
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.clockPanel .pill{
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.clockPill{ font-weight: 800; font-size: 14px; }
.datePill{ font-size: 12px; }

/* ===== DÜZEN: 2 kolon (masaüstü) ===== */
#sellerCard{ grid-column:1; }
#deliveryCard{ grid-column:2; }
#calcCard{ grid-column:1; }
#reportCard{ grid-column:2; }
#paymentCard{ grid-column:1 / -1; } /* sayfa içinde tek kolon gibi */
#listCard{ grid-column:1 / -1; }

/* Küçük ekranlarda tek kolon */
/* Print */
.printOnly{display:none}
.printGrid{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;font-size:12px}
#printBlockDelivery h1,#printBlockReport h1{font-size:16px;margin:0 0 8px}
#printBlockDelivery h2,#printBlockReport h2{font-size:13px;margin:10px 0 6px}
#printBlockDelivery hr,#printBlockReport hr{border:0;border-top:1px solid #ddd;margin:10px 0}

@media print{
  body{background:#fff}
  .clockPanel{ display:none !important; }
  .wrap{max-width:100%;margin:0;padding:0}
  @page{margin:10mm}

  /* default: hiçbir şey basma */
  body.print-mega .sidebar, body.print-mega .footer{display:none !important}
  body.print-mega .layout > *{display:none !important}
  body.print-mega .layout main{display:block !important}
  body.print-mega #megaCard{display:block !important}

  #deliveryCard,#sellerCard,#calcCard,#listCard,#reportCard,#paymentCard,.sidebar,.footer{display:none !important}

  /* mega kart yazdır */
  body.print-mega #megaCard{display:block !important;border:0;box-shadow:none}
  body.print-mega #megaCard *{visibility:visible}

  /* rapor yazdır */
  body.print-report #reportCard{display:block !important;border:0;box-shadow:none}
  body.print-report #reportCard > *:not(#printBlockReport){display:none !important}
  body.print-report #printBlockReport{display:block !important}


  /* rapor yazdır: Satıcılar (Ayrı Ayrı) bölümünü BASKIDAN kaldır */
  body.print-report #repSellersCard{display:none !important}
  /* teslim yazdır butonu: SADECE satıcı + hesap tablosu */
  body.print-seller-calc #sellerCard,
  body.print-seller-calc #calcCard{
    display:block !important;
    border:0;
    box-shadow:none;
  }
  body.print-seller-calc #calcCard #printBlockDelivery{display:none !important}
}

.footer{margin-top:10px}

/* Sayfayı tek ekrana sığdırma */


@media print{ body.print-report .rpLine{white-space:normal; overflow:visible} body.print-report .rpLine span{white-space:normal} }

@media print{ body.print-report .rpLine span{display:inline-block; margin-right:4px} }

.hr{height:1px;background:var(--line);margin:10px 0}

/* Gün Sonu: sağ kolon */
.twoCols{position:relative}
.rightCol{float:right; width:48%}
.twoCols .tableWrap:not(.rightCol){width:48%}
.clr{clear:both}
@media (max-width: 900px){
  .rightCol, .twoCols .tableWrap:not(.rightCol){float:none; width:100%}
}

/* Gün Sonu dikey yerleşim */
.gsStack{display:flex; flex-direction:column; gap:12px}
.gsBlock{width:100%}

/* Alt özet şeridi: yatay */
.gsFooter .summaryRow{
  display:flex;
  gap:12px;
}
.gsFooter .summaryRow > div{
  flex:1;
}

/* Responsive */
@media (max-width: 900px){
  .gsFooter .summaryRow{flex-direction:column}
}


/* Gün Sonu düzen: 3 satır (tam genişlik) */
.gsStack{display:flex; flex-direction:column; gap:12px}
.gsBlock{width:100%}

/* 1. satır: Çeşitlere Göre Toplam içinde iki tablo yan yana */
.gsRowTables{display:flex; gap:12px}
.gsRowTables .tableWrap{flex:1; overflow:visible}
.gsRowTables table{width:100%}

/* 2. satır: Günlük Ödeme Özeti tam genişlik */
.gsStack .gsBlock:nth-child(2) .card{width:100%}

/* 3. satır: Alt özet şeridi yatay */
.gsFooter .summaryRow{display:flex; gap:12px}
.gsFooter .summaryRow > div{flex:1}

/* Mobilde alt alta */
@media (max-width: 900px){
  .gsRowTables{flex-direction:column}
  .gsFooter .summaryRow{flex-direction:column}
}


/* Gün Sonu: Çeşitlere Göre Toplam ve Günlük Ödeme Özeti aynı boy ve hizalı */
.gsStack .gsBlock{
  display:flex;
}
.gsStack .gsBlock > .card,
.gsStack .gsBlock > div > .card{
  width:100%;
  box-sizing: border-box;
}



/* Günlük Ödeme Özeti hizalama düzeltmesi */
.gsStack .gsBlock .tableWrap,
.gsStack .gsBlock .tableWrap table {
  width: 100%;
  box-sizing: border-box;
}
/* İlk iki satır kartları eşitle */
.gsStack .gsBlock:nth-child(1),
.gsStack .gsBlock:nth-child(2){
  align-items:stretch;
}



/* ==== TEK KART (MEGA) ==== */
.megaCard{padding:14px}
.megaHeader{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px}
.megaClock{display:flex; gap:10px; align-items:center}
.repSellersList{margin-top:10px; padding:10px; border:1px solid var(--line); border-radius:12px}
.repSellersList .repTitle{font-weight:700; margin-bottom:6px}
.repSellersList .repRow{display:flex; justify-content:space-between; gap:10px; padding:6px 0; border-top:1px dashed var(--line)}
.repRowTop{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:4px}
.repRowActions{flex:0 0 auto;display:flex;gap:6px}
.repSellersList .repRow:first-of-type{border-top:none}
.repSellersList .repRow .muted{color:var(--muted)}
@media (max-width: 900px){
  .megaHeader{flex-direction:column; align-items:flex-start}
}


/* Borç pill gizle (fonksiyonlar çakışmasın diye DOM'da kalsın) */
#sellerDebt{display:none !important;}

#dateLine{ font-weight:800; font-size:14px; }


/* ===== Footer: giriş bilgisi + çıkış ===== */
.footerBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:6px 4px;
}
.footerAuth{display:flex; align-items:center; gap:10px; justify-content:flex-end; flex-wrap:wrap;}
.footerAuth b{color:var(--text)}
@media (max-width: 700px){
  .footerBar{flex-direction:column; align-items:flex-start}
  .footerAuth{width:100%; justify-content:space-between}
}

/* ===== SATİCI ÖDENEN DURUM RENK ===== */
#sellerPaid.paid{border-color:rgba(10,122,59,.45);background:rgba(10,122,59,.10);color:var(--green);font-weight:900}
#sellerPaid.unpaid{border-color:rgba(180,35,24,.45);background:rgba(180,35,24,.10);color:var(--red);font-weight:900}


/* ===== RAPORLAR > SATICILAR (AYRI AYRI) ÖDEME DURUM ROZETİ ===== */
.repPay{display:inline-block;padding:3px 8px;border-radius:999px;border:1px solid var(--line);font-weight:900;font-size:12px;line-height:1}
.repPay.paid{color:var(--green);border-color:rgba(10,122,59,.35);background:rgba(10,122,59,.08)}
.repPay.unpaid{color:var(--red);border-color:rgba(180,35,24,.35);background:rgba(180,35,24,.08)}


/* WhatsApp Destek Alt Bölüm */
.whatsapp-support-footer {
  position: sticky;
  bottom: 0;
  width: 100%;
  background: #0f172a;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 10px 12px;
  display: flex;
  justify-content: center;
  z-index: 50;
}

.whatsapp-support-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #e5e7eb;
  font-weight: 600;
}

.whatsapp-support-link:hover {
  text-decoration: underline;
}

.whatsapp-icon {
  font-size: 18px;
}


/* Raporlar > Satıcılar (Ayrı Ayrı) Arama */
.repSearchBar{
  margin: 10px 0 12px;
}
.repSearchInput{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  outline: none;
}
.repSearchInput:focus{
  border-color: rgba(0,0,0,0.28);
}


/* Satıcılar (Ayrı Ayrı) listesi 5 satırdan sonra uzamasın */
#repSellersList.repSellersList{
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
#repSellersList.repSellersList::-webkit-scrollbar{ width: 8px; }
#repSellersList.repSellersList::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,0.18);
  border-radius: 999px;
}
#repSellersList.repSellersList::-webkit-scrollbar-track{ background: transparent; }

/* Satıcı satır detay aç/kapa */
.repRow{
  cursor: pointer;
}
.repRow .repDetails{
  display: none;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.04);
}
.repRow.expanded .repDetails{
  display: block;
}

/* === Siyah WhatsApp bar üzerinde ADMIN Ayarlar === */
.whatsapp-support-footer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center; /* WhatsApp ortada kalsın */
}

.footerAdminSettings{
  position: absolute;
  left: 12px;                 /* Raporlar hizasına yakın sol */
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #e5e7eb;             /* beyaz */
  font-weight: 600;           /* WhatsApp yazısı ile aynı */
  font-size: 16px;            /* aynı boy */
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
}
.footerAdminSettings:hover{
  background: rgba(255,255,255,0.12);
}

/* Sadece ADMIN görsün */
body:not(.is-admin) .footerAdminSettings{
  display: none !important;
}

/* Raporlar > Sınıf/Kg: Çeşide göre başlık satırı */
.gradeGroupRow td{
  font-weight: 800;
  background: rgba(0,0,0,0.06);
}

/* Raporlar > Sınıf/Kg: Çeşitlere göre kolon görünümü */
.gradeGrid{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.gradeMini{
  width: 180px; /* gerekirse dar */
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.gradeMini table{
  width: 100%;
  border-collapse: collapse;
}
.gradeMini th, .gradeMini td{
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 13px;
}
.gradeMini thead th{
  background: rgba(0,0,0,0.06);
  font-weight: 800;
}
.gradeMini tbody tr:last-child td{ border-bottom: none; }
.gradeMini .r{ text-align: right; }

/* Eski tek tabloyu gizle (sadece raporlar görünümü için) */
#repByGrade{ display:none; }



/* === Raporlar: Çeşitlere Göre Toplam -> TEK MATRIS TABLO (görsel), fonksiyonlara dokunmaz === */
.repOldTables{ display:none !important; }

.repMatrixTbl{
  table-layout: fixed;
  width: 100%;
}

.repMatrixTbl th, .repMatrixTbl td{ 
  text-align:center; 
  font-variant-numeric: tabular-nums;
  min-width:100px;
  padding: 8px 4px;
}

.repMatrixTbl th:first-child, .repMatrixTbl td:first-child{ 
  text-align:left; 
  min-width:140px; 
}

.repMatrixTbl thead th{
  background: linear-gradient(180deg, #eef3f9, #e7eef7);
  font-weight: 800;
  border-bottom: 1px solid var(--line);
}

.repMatrixTbl tfoot th, .repMatrixTbl tfoot td{
  background:#fafafa;
  font-weight: 900;
  text-align:center;
  padding: 8px 4px;
}

.repMatrixTbl tfoot th:first-child{
  text-align:left;
}

.repMatrixWrap{ 
  overflow:hidden;
  max-width: fit-content;
}
