/* ===========================
   ÖZET RAPOR
   =========================== */

.rapor-ozet-page {
  display: flex; flex-direction: column; gap: 16px; height: 100%;
}

/* MODULE HEAD */
.module-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-shrink: 0; gap: 12px;
}
.module-title { font-size: 17px; font-weight: 700; color: #20180c; margin: 0; }
.module-sub   { font-size: 12px; color: #9e8e76; margin: 2px 0 0; }

.ro-guncelleme-badge {
  font-size: 11px; color: #9e8e76;
  background: rgba(200,148,60,.08); border: 1px solid #ddd0bb;
  padding: 4px 10px; border-radius: 20px; white-space: nowrap; align-self: center;
}

/* KARTLAR */
.ro-kartlar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; flex-shrink: 0;
}
@media (max-width: 900px) { .ro-kartlar { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .ro-kartlar { grid-template-columns: 1fr; } }

.ro-kart {
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.ro-kart--blue   { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; }
.ro-kart--green  { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; }
.ro-kart--coral  { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }
.ro-kart--amber  { background: linear-gradient(135deg, #c8943c, #a97329); color: #fff; }

.ro-kart-ust {
  display: flex; align-items: center; gap: 8px; opacity: .9;
}
.ro-kart-ico { width: 20px; height: 20px; flex-shrink: 0; }
.ro-kart-etiket { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

.ro-kart-val {
  font-size: 24px; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.ro-kart-val--sm { font-size: 16px; word-break: break-word; line-height: 1.3; }

.ro-kart-alt { font-size: 11px; opacity: .75; }

/* GRAFİK */
.ro-grafik-baslik {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700; color: #4a3e2c; flex-shrink: 0;
}
.ro-legend { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #7a6d58; }
.ro-legend-dot {
  width: 10px; height: 10px; border-radius: 3px; display: inline-block;
}
.ro-legend-dot--ciro     { background: #2563eb; }
.ro-legend-dot--tahsilat { background: #16a34a; }

.ro-grafik-wrap {
  flex: 1; position: relative; min-height: 140px; max-height: 220px;
  border: 1px solid #ddd0bb; border-radius: 12px;
  background: linear-gradient(180deg, #fdf9f3 0%, #f6efe3 100%);
  padding: 12px;
  box-sizing: border-box;
}
.ro-grafik { width: 100%; height: 100%; display: block; }
.ro-grafik-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #b0a08a; background: rgba(253,249,243,.7);
  border-radius: 12px; pointer-events: none;
}


/* ===========================
   DÖNEMSEl RAPOR
   =========================== */

.rapor-donem-page {
  display: flex; flex-direction: column; gap: 14px; height: 100%;
}

.rd-excel-btn, .rd-print-btn {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid #d6c8b4;
  background: linear-gradient(180deg, #f9f3e8 0%, #f0e4cc 100%);
  color: #4a3e2c; transition: all .15s;
}
.rd-excel-btn:hover, .rd-print-btn:hover {
  border-color: #c8943c; background: linear-gradient(180deg, #f6ead5 0%, #ecd8b5 100%);
}

/* TOOLBAR */
.rd-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0;
}
.rd-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.rd-pill {
  height: 32px; padding: 0 12px; border-radius: 20px;
  border: 1px solid #d6c8b4; background: transparent;
  font-family: inherit; font-size: 12px; font-weight: 600; color: #7a6d58;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.rd-pill:hover  { background: rgba(200,148,60,.08); border-color: #c8943c; }
.rd-pill.active { background: #c8943c; border-color: #c8943c; color: #fff; }

.rd-ozel-wrap {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.rd-date-input {
  height: 32px; padding: 0 10px; border: 1px solid #d6c8b4; border-radius: 8px;
  font-family: inherit; font-size: 12px; color: #20180c;
  background: linear-gradient(180deg,#fdf9f3,#f6efe3);
  outline: none;
}
.rd-date-input:focus { border-color: #c8943c; box-shadow: 0 0 0 2px rgba(200,148,60,.1); }
.rd-date-sep { color: #b0a08a; font-size: 12px; }
.rd-ara-btn {
  height: 32px; padding: 0 14px; border-radius: 8px;
  background: #c8943c; border: none; color: #fff;
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.rd-ara-btn:hover { background: #a97329; }

/* ÖZET ŞERİT */
.rd-ozet-serit {
  display: flex; align-items: center; gap: 0;
  background: linear-gradient(180deg, #fdf9f3 0%, #f4ead8 100%);
  border: 1px solid #ddd0bb; border-radius: 10px;
  padding: 12px 0; flex-shrink: 0; flex-wrap: wrap;
}
.rd-ozet-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; flex: 1; padding: 0 16px;
}
.rd-ozet-sep { width: 1px; background: #ddd0bb; align-self: stretch; }
.rd-ozet-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #9e8e76; }
.rd-ozet-val { font-size: 18px; font-weight: 800; color: #20180c; font-variant-numeric: tabular-nums; }
.rd-ozet-val--blue  { color: #1d4ed8; }
.rd-ozet-val--green { color: #15803d; }
.rd-ozet-val--red   { color: #b91c1c; }

/* TABLO */
.rd-table-wrap {
  flex: 1; overflow-y: auto; border-radius: 10px; border: 1px solid #ddd0bb;
}
.rd-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.rd-th {
  position: sticky; top: 0; z-index: 2;
  background: linear-gradient(180deg, #f4ead8 0%, #ede0c8 100%);
  padding: 9px 12px; text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: #7a6d58;
  border-bottom: 1px solid #ddd0bb; white-space: nowrap;
}
.rd-th-num    { text-align: right; }
.rd-th-center { text-align: center; }

.rd-tr { border-bottom: 1px solid #ede3d4; transition: background .1s; }
.rd-tr:last-child { border-bottom: none; }
.rd-tr:hover { background: rgba(200,148,60,.07); }
.rd-tr.kapali { opacity: .6; }

.rd-td { padding: 10px 12px; color: #20180c; vertical-align: middle; }
.rd-td-num    { text-align: right; font-variant-numeric: tabular-nums; }
.rd-td-center { text-align: center; }
.rd-td-tarih  { font-size: 12px; color: #9e8e76; white-space: nowrap; }
.rd-td-musteri{ font-weight: 700; }
.rd-td-urun   { color: #4a3e2c; }
.rd-td-fiyat  { font-weight: 600; }
.rd-td-odenen { color: #15803d; font-weight: 600; }
.rd-td-kalan  { color: #b91c1c; font-weight: 700; }
.rd-td-kalan.zero { color: #9e8e76; font-weight: 400; }

.rd-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.rd-badge.borclu { background: #fde8e0; color: #7a2413; }
.rd-badge.kapali { background: #d4e8c2; color: #2d6e1a; }

.rd-empty, .rd-loading {
  padding: 40px; text-align: center; font-size: 13px; color: #b0a08a;
}

/* YAZDIR butonu */
.rd-print-btn {
  align-self: flex-start;
  display: none; /* JS ile gösterilecek */
}

/* PRINT STİLİ */
@media print {
  .module-head button, .rd-toolbar, .rd-print-btn,
  .rd-excel-btn, .topbar, .actions { display: none !important; }
  .rd-table-wrap { overflow: visible; border: none; }
  .rd-th { background: #eee !important; -webkit-print-color-adjust: exact; }
}

/* ===== KOYU TEMA ===== */
body.dark .module-title { color: #e0d4c0; }
body.dark .module-sub   { color: #6a5a48; }
body.dark .rd-date-input {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  border-color: #3a3028;
  color: #e0d4c0;
}
body.dark .rd-date-input:focus { border-color: #c8943c; }
body.dark .rd-ara-btn {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  border-color: #3a3028;
  color: #c0b0a0;
}
body.dark .rd-pill { border-color: #3a3028; color: #8a7a68; }
body.dark .rd-pill.active { background: #c8943c; border-color: #c8943c; color: #fff; }
body.dark .rd-ozet-serit { background: rgba(255,255,255,0.04); border-color: #3a3028; }
body.dark .rd-ozet-item { border-color: #3a3028; }
body.dark .rd-ozet-label { color: #6a5a48; }
body.dark .rd-ozet-val { color: #e0d4c0; }
body.dark .rd-ozet-val--blue  { color: #80b8e8; }
body.dark .rd-ozet-val--green { color: #7ecf5a; }
body.dark .rd-ozet-val--red   { color: #e8725a; }
body.dark .rd-table-wrap { border-color: #3a3028; }
body.dark .rd-th {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  color: #6a5a48;
  border-color: #3a3028;
}
body.dark .rd-tr { border-color: #3a3028; }
body.dark .rd-tr:hover { background: rgba(200,148,60,0.06); }
body.dark .rd-td { color: #c0b0a0; }
body.dark .rd-td-urun   { color: #e0d4c0; }
body.dark .rd-td-musteri { color: #a09080; }
body.dark .rd-td-fiyat  { color: #7ecf5a; }
body.dark .rd-td-odenen { color: #7ecf5a; }
body.dark .rd-td-kalan  { color: #e8725a; }
body.dark .rd-td-kalan.zero { color: #6a5a48; }
body.dark .rd-badge { background: rgba(200,148,60,0.15); color: #c8943c; }
body.dark .rd-badge.borclu { background: rgba(232,114,90,0.15); color: #e8725a; }
body.dark .rd-badge.kapali { background: rgba(255,255,255,0.06); color: #6a5a48; }
body.dark .rd-excel-btn, body.dark .rd-print-btn {
  background: linear-gradient(180deg, #2a2218 0%, #221c14 100%);
  border-color: #3a3028;
  color: #c0b0a0;
}
body.dark .rd-empty, body.dark .rd-loading { color: #6a5a48; }
body.dark .ro-guncelleme-badge { background: rgba(200,148,60,0.08); border-color: #3a3028; color: #8a7a68; }
body.dark .ro-grafik-baslik { color: #c0b0a0; }
body.dark .ro-legend { color: #7a6a58; }
