:root { --ink:#1d2433; --muted:#5b6475; --line:#d9dde5; --accent:#1f5fbf; --bg:#f6f7f9; --ok:#1e7a3c; --warn:#9a6200; --bad:#b3261e; }
* { box-sizing:border-box; }
body { margin:0; font:16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color:var(--ink); background:var(--bg); }
a { color:var(--accent); }
.topbar { display:flex; gap:24px; align-items:center; padding:12px 24px; background:#fff; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.topbar .brand { font-weight:700; font-size:18px; text-decoration:none; color:var(--ink); }
.topbar nav { display:flex; gap:16px; flex:1; }
.topbar .me { display:flex; gap:12px; align-items:center; }
.page { max-width:1100px; margin:24px auto; padding:0 16px; }
.narrow { max-width:440px; margin:48px auto; padding:0 16px; }
.card { background:#fff; border:1px solid var(--line); border-radius:8px; padding:20px; }
.card div { margin-bottom:14px; }
label { display:block; font-weight:600; margin-bottom:4px; }
input[type=text], input[type=password], input[type=email], input:not([type]), select { width:100%; padding:10px; font-size:16px; border:1px solid var(--line); border-radius:6px; }
input[type=checkbox] { width:auto; }
button, .button { display:inline-block; background:var(--accent); color:#fff; border:0; border-radius:6px; padding:10px 18px; font-size:16px; cursor:pointer; text-decoration:none; }
[hidden] { display:none !important; }
button.link { background:none; color:var(--accent); padding:0; }
.actions { display:flex; gap:12px; margin-top:16px; flex-wrap:wrap; }
.actions button { background:#fff; color:var(--ink); border:1px solid var(--line); }
.actions button.primary, button.primary { background:var(--accent); color:#fff; border:0; font-weight:600; }
button.secondary { background:#fff; color:var(--accent); border:1px solid var(--accent); }
table { width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line); margin:12px 0; }
th, td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); vertical-align:top; font-size:14px; }
tr.inactive td { color:var(--muted); }
.muted { color:var(--muted); }
.msg { padding:10px 14px; border-radius:6px; background:#eef3fb; }
.msg.error { background:#fbeceb; color:var(--bad); }
.msg.warning { background:#fff5e0; color:var(--warn); }
.msg.success { background:#e8f5ec; color:var(--ok); }
.helptext, .errorlist { font-size:13px; color:var(--muted); }
.errorlist { color:var(--bad); padding-left:18px; }
.qr svg { width:220px; height:220px; background:#fff; }
.secret code { font-size:22px; }
.filters { display:flex; gap:12px; align-items:end; flex-wrap:wrap; }
.filters label { font-weight:400; }
.pager { display:flex; gap:12px; }
@media (max-width:600px) { .topbar nav { flex-basis:100%; order:3; } th, td { font-size:13px; } }
.page-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.button.secondary { background:#fff; color:var(--accent); border:1px solid var(--accent); }
.stats { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:12px; margin:12px 0; }
.stat { background:#fff; border:1px solid var(--line); border-radius:8px; padding:12px 14px; }
.stat span { display:block; color:var(--muted); font-size:14px; }
.stat strong { font-size:clamp(17px, 1.6vw, 22px); white-space:nowrap; display:block; }
.stat.total { border-color:var(--accent); }
.stats.cols-6 { grid-template-columns:repeat(6, minmax(0, 1fr)); }
.stats.cols-5 { grid-template-columns:repeat(5, minmax(0, 1fr)); }
.stats.cols-6 .stat, .stats.cols-5 .stat { container-type:inline-size; min-width:0; padding:12px; }
.stats.cols-6 .stat strong, .stats.cols-5 .stat strong { font-size:clamp(13px, 11cqi, 22px); }
a.stat.link { color:inherit; text-decoration:none; transition:border-color .15s, box-shadow .15s; }
a.stat.link:hover, a.stat.link:focus-visible { border-color:var(--accent); box-shadow:0 2px 8px rgba(0,0,0,.08); }
a.stat.link.due strong { color:var(--bad); }
@media (max-width: 1000px) { .stats.cols-6, .stats.cols-5 { grid-template-columns:repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stats.cols-6, .stats.cols-5 { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
.cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:12px; margin-top:16px; }
.unit-card { display:block; background:#fff; border:1px solid var(--line); border-left:4px solid var(--ok); border-radius:8px; padding:12px; color:var(--ink); text-decoration:none; }
.unit-card:hover { border-color:var(--accent); }
.unit-card.debt { border-left-color:var(--bad); }
.unit-card.inactive { border-left-color:var(--muted); opacity:.7; }
.unit-head { display:flex; gap:8px; align-items:baseline; }
.unit-head strong { font-size:22px; }
.badge { margin-left:auto; font-size:12px; padding:2px 8px; border-radius:10px; background:var(--bg); border:1px solid var(--line); }
.tenant { color:var(--muted); font-size:14px; margin:4px 0; }
.debt-total { font-size:18px; font-weight:700; }
.debt-lines { display:grid; grid-template-columns:auto 1fr; gap:0 8px; margin:6px 0 0; font-size:13px; }
.debt-lines dt { color:var(--muted); }
.debt-lines dd { margin:0; text-align:right; }
textarea { width:100%; padding:10px; font-size:16px; border:1px solid var(--line); border-radius:6px; font-family:inherit; }
input[type=number] { width:100%; padding:10px; font-size:16px; border:1px solid var(--line); border-radius:6px; }
.receipt { background: #fff; border: 1px solid #ccc; border-radius: 6px; padding: 1.2rem 1.4rem; max-width: 148mm; }
.receipt header h2 { margin: 0 0 .2rem; }
.receipt .stamp { color: #b00020; font-weight: bold; font-size: 1.2rem; border: 2px solid #b00020; display: inline-block; padding: .2rem .6rem; }
.receipt-info { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; }
.receipt-info dt { font-weight: bold; }
.receipt-info dd { margin: 0; }
.print-page { background: #fff; padding: 0; }
/* Sayfa boyutları isimli sayfalarla: makbuz A5, rapor ve listeler A4 yatay */
body.print-page:not(.report-print) { page: makbuz; }
body.report-print { page: report; }
@page makbuz { size: A5; margin: 10mm; }
@media print {
  .topbar, .no-print, .actions, .msg { display: none !important; }
  body, .print-page { background: #fff; }
  .receipt { border: none; padding: 0; max-width: none; }
}
tr.changed td { background: #fff4d6; }
tr.row-error td { background: #fde4e4; }
table.readings input { width: 7.5rem; }
table.summary td:last-child, table.summary th:last-child { text-align: right; white-space: nowrap; }
fieldset.card label { display: block; margin: .3rem 0; }
td input { display: inline-block; width: auto; max-width: 9rem; }
table.report td.money, table.report td.number, table.report td.percent,
table.report th.money, table.report th.number, table.report th.percent { text-align: right; white-space: nowrap; }
table.report tr.total td, table.report tr.subtotal td, table.report tr.opening td { font-weight: 700; background: #f3f5f8; }
.report-print { padding: 0 8mm; font-size: 11px; }
@media print { @page report { size: A4 landscape; } .report-print table { font-size: 9px; } }
.person-card .unit-head { flex-wrap: wrap; }
.people { list-style: none; padding: 0; margin: .4rem 0; font-size: .95rem; }
.people li { padding: 2px 0; }
.menu-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.menu-bar > a, details.menu > summary { padding: 6px 10px; border-radius: 6px; cursor: pointer; color: inherit; text-decoration: none; }
.menu-bar > a:hover, details.menu > summary:hover, details.menu[open] > summary { background: #eef3fa; }
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: " ▾"; font-size: .8em; }
.menu-list { position: absolute; top: 100%; left: 0; z-index: 20; min-width: 180px; background: #fff; border: 1px solid #d6dbe3; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px 0; margin-top: 4px; }
.menu-list a { display: block; padding: 8px 14px; color: #1d2a3a; text-decoration: none; white-space: nowrap; }
.menu-list a:hover { background: #eef3fa; }
/* Yana açılan alt menü (Elektrik / Su, Banka, Giderler / Tamirat): masaüstünde fareyle veya klavye odağıyla
   sağa açılır, sığmazsa sola (.sola); dar ekranda dokununca aynı yerde aşağı açılır (.acik). */
.alt-menu { position: relative; }
.menu-list button.alt-baslik { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%;
  background: none; color: #1d2a3a; border: 0; border-radius: 0; padding: 8px 14px; font: inherit; text-align: left; white-space: nowrap; cursor: pointer; }
.menu-list button.alt-baslik::after { content: "▸"; font-size: .85em; color: var(--muted); }
.alt-menu:hover > .alt-baslik, .alt-menu.acik > .alt-baslik, .alt-menu:focus-within > .alt-baslik { background: #eef3fa; }
.menu-list .alt-list { display: none; top: -7px; left: 100%; margin: 0 0 0 2px; }
.alt-menu.acik > .alt-list { display: block; }
.alt-menu.sola > .alt-list, details.menu.sag .alt-list { left: auto; right: 100%; margin: 0 2px 0 0; }
.menu-ayrac { display: block; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-bar > a:focus-visible, details.menu > summary:focus-visible, .menu-list a:focus-visible, .menu-list button.alt-baslik:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px; }
@media (min-width: 901px) {
  .alt-menu:hover > .alt-list, .alt-menu:focus-within > .alt-list { display: block; }
}
@media print { .menu-bar { display: none; } }
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.person-card dl.debt-lines { display: grid; grid-template-columns: 1fr; gap: 0; }
.person-card dl.debt-lines dt { color: var(--muted); font-size: 12px; margin-top: 6px; }
.person-card dl.debt-lines dd { margin: 0; text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.plain { border: 0; background: transparent; margin: 6px 0; }
table.plain td, table.plain th { border: 0; padding: 4px 6px 4px 0; }
.unit-head a.badge { margin-left: auto; text-decoration: none; }
.wide-page { max-width: none; padding-left: 16px; padding-right: 16px; }
table.rent-table { font-size: 13px; }
table.rent-table td, table.rent-table th { vertical-align: top; padding: 6px 8px; }
table.rent-table td.dates { min-width: 92px; }
.cell { display: block; padding: 2px 6px; margin: 2px 0; border-radius: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.legend .cell { display: inline-block; margin-right: 8px; }
table.rent-table td.money { white-space: nowrap; }
.cell.yesil { background: #d9f2df; color: #145c2c; }
.cell.turuncu { background: #ffe5c2; color: #8a4b00; }
.cell.kirmizi { background: #fbd5d5; color: #8f1d1d; }
@media print { table.rent-table { font-size: 9px; } .cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.repairs-box { margin: 16px 0; }
.repairs-box .page-head h2 { margin: 0; }
.repairs-box table { margin-bottom: 0; }
.repair-card h3 { margin: 12px 0 4px; font-size: 15px; color: var(--muted); }
.repair-card p { margin: 0 0 8px; }
.badge.status-acik { background: #fff4d6; border-color: #e8c66a; }
.badge.status-tamam { background: #d9f2df; border-color: #8fd0a2; }
.badge.status-iptal { background: #eee; color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
table.month-bars td.bar { width: 45%; }
table.month-bars progress { width: 100%; height: 12px; accent-color: var(--accent); }
.qr svg { display: block; margin: 12px auto; max-width: 100%; height: auto; }
.copy { font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.info-card { max-width: 420px; text-align: center; }
form.inline { display: inline; }
/* Liste sayfalarının yazdırılması: A4 yatay, düğmeler/süzgeçler/menü gizli */
main[data-yazdir] { page: liste; }
@page liste { size: A4 landscape; margin: 10mm; }
@media print {
  main[data-yazdir] form.filters, main[data-yazdir] .actions, main[data-yazdir] button { display: none !important; }
  main[data-yazdir] { padding: 0; max-width: none; }
  main[data-yazdir] table { font-size: 10px; }
  main[data-yazdir] a { color: inherit; text-decoration: none; }
  .stat, .unit-card { break-inside: avoid; }
}
/* Revizyon 9: üst menü (sekmeler, daire no kutusu, kullanıcı menüsü, dar ekranda tek "Menü" düğmesi) */
.topbar { gap: 12px 18px; }
.topbar nav.menu-bar { flex: 1; }
.menu-ac { display: none; }  /* masaüstünde menü düğmesi yok: klavyede boş durak olmasın */
.menu-dugme { display: none; margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-weight: 600; }
details.menu.sag .menu-list { left: auto; right: 0; }
.menu-list a.ikincil { color: var(--muted); border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; font-size: 14px; }
.menu-list .rol { display: block; padding: 4px 14px 8px; font-size: 13px; }
.menu-list form { padding: 8px 14px; }
details.menu.me > summary { font-weight: 600; }
.daire-git { display: flex; gap: 6px; align-items: center; }
.daire-git input { width: 92px; padding: 7px 8px; font-size: 16px; }
.daire-git button { padding: 7px 12px; font-size: 15px; }
@media (max-width: 900px) {
  .menu-dugme { display: inline-block; }
  .menu-ac { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
  .topbar nav.menu-bar { display: none; flex-basis: 100%; order: 5; flex-direction: column; align-items: stretch; }
  .menu-ac:checked ~ nav.menu-bar { display: flex; }
  .menu-ac:focus-visible + .menu-dugme { outline: 2px solid var(--accent); outline-offset: 2px; }
  .menu-list { position: static; box-shadow: none; border: 0; padding-left: 12px; }
  .menu-list .alt-list, .alt-menu.sola > .alt-list, details.menu.sag .alt-list { margin: 0; padding: 0 0 4px 14px; }
  .menu-list button.alt-baslik::after { content: "▾"; }
  .alt-menu.acik > .alt-baslik::after { content: "▴"; }
  .daire-git { order: 4; }
}
@media print { .daire-git, .menu-dugme, details.menu.me { display: none; } }
/* Tablolar: dar ekranda tablo kendi içinde kayar, sayfa yana kaymaz; tutarlar sağa yaslı */
main table { display: block; overflow-x: auto; max-width: 100%; }
main table > thead, main table > tbody, main table > tfoot { width: 100%; }
@media (min-width: 901px) { main table { display: table; } }
td.money, th.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.page-head + table, .card table { margin-top: 8px; }
/* Düğme düzeni: sayfa başına tek birincil (mavi) düğme; diğerleri ikincil, Vazgeç/süzgeç sade, iptal kırmızı */
.button.ghost, button.ghost { background: transparent; color: var(--accent); border: 1px solid transparent; }
.button.ghost:hover, button.ghost:hover { background: #eef3fa; }
.button.danger, button.danger { background: #fff; color: var(--bad); border: 1px solid var(--bad); }
.filters button { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
form > .card button[type=submit]:not(.secondary):not(.ghost) { font-weight: 600; }
details.gecmis { margin: 16px 0; }
details.gecmis > summary { cursor: pointer; }
details.gecmis > summary h2 { display: inline; font-size: 1.2em; }
.print-only { display: none; }
@media print { .print-only { display: inline; } .no-print { display: none !important; } }
.ayar-bolumleri { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.ayar-kart { display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.ayar-kart:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.ayar-kart strong { display: block; font-size: 17px; margin-bottom: 4px; color: var(--accent); }
.ayar-kart span { color: var(--muted); font-size: 14px; }
.ayar-formu { max-width: 560px; }
details.odenenler { margin: 0 0 12px; }
details.odenenler > summary { cursor: pointer; color: var(--accent); padding: 6px 0; }
.stat small { display: block; font-size: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chips a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; text-decoration: none; color: var(--ink); }
.chips a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
table.rent-table thead th { position: sticky; top: 0; background: #f0f3f8; z-index: 1; }
.card.adim h2 { margin-top: 0; }
.alan { margin-bottom: 12px; }
label.secim { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 8px 0; }
.belge { max-width: 760px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.belge table.bilgi th { width: 140px; color: var(--muted); font-weight: 400; }
.imzalar { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; }
.imzalar div { border-top: 1px solid var(--ink); padding-top: 6px; display: grid; }
.imzalar span:last-child { color: var(--muted); font-size: 13px; }
tfoot th { background: #f0f3f8; }
.stat.due strong { color: var(--bad); }
@media print { .belge { border: 0; padding: 0; } }
.badge.gecikme-1-30 { background: #fff4d6; border-color: #e8c66a; }
.badge.gecikme-31-60 { background: #ffe1c2; border-color: #e6a35c; }
.badge.gecikme-60 { background: #fbd5d5; border-color: #d98080; color: #8f1d1d; }
tr.takip td { border-top: 0; padding-top: 0; font-size: 13px; }
details.not-ekle { display: inline-block; margin-right: 8px; }
details.not-ekle > summary { cursor: pointer; color: var(--accent); }
.kurtarma { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
.kurtarma code { font-size: 20px; letter-spacing: 1px; }
.badge.status-uyari { background: #fff4d6; border-color: #e8c66a; color: #7a4d00; }
.due { color: var(--bad); }

/* Revizyon 10 / Paket D */
.paid { color: var(--ok); }
h2.tek-satir { font-size: 1.1em; display: flex; gap: 12px; align-items: baseline; }
h2.tek-satir .paid { font-size: .85em; font-weight: 500; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.table-wrap > table { display: table; }
.icerige-atla { position: absolute; left: -9999px; top: 0; z-index: 100; background: #fff; padding: 8px 14px; border: 2px solid var(--accent); border-radius: 6px; }
.icerige-atla:focus { left: 12px; top: 12px; }
.menu-bar a[aria-current="page"], .menu-list a[aria-current="page"] { font-weight: 700; color: var(--ink); }
.daire-git input { font-size: 16px; }
.pesin { background: #eef7f0; border-radius: 6px; padding: 6px 10px; }
.badge.kurum-odendi { background: #e6f4ea; border-color: #9fd3ad; color: var(--ok); }
.badge.kurum-gecikti { background: #fbd5d5; border-color: #d98080; color: #8f1d1d; }
.badge.kurum-yaklasti, .badge.kurum-kismen { background: #fff4d6; border-color: #e8c66a; color: #7a4d00; }
.kurum-odeme summary.button { display: inline-block; margin: 6px 0; }
.badge.ariza-yeni { background: #fff4d6; border-color: #e8c66a; color: #7a4d00; }
.badge.ariza-tamirat { background: #e8f0fc; border-color: #9bb7e3; color: var(--accent); }
.badge.ariza-kapandi { background: #e6f4ea; border-color: #9fd3ad; color: var(--ok); }
img.ariza-foto { max-width: 100%; max-height: 480px; border-radius: 8px; border: 1px solid var(--line); }
.badge.kurum-kabul { background: #eef1f6; border-color: #c9d0dc; color: var(--muted); }
.badge.kurum-fazla { background: #fff4d6; border-color: #e8c66a; color: #7a4d00; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
