* { box-sizing: border-box; margin: 0; padding: 0; }

/* "Öneri" tek renk ailesi — index rozeti + yönetim öneri alanları aynı tonu kullanır.
   Kontrast (ölçüldü): mürekkep/zemin 7.00:1, mürekkep/girdi 7.29:1, kenar/girdi 4.75:1, kenar/satır 4.44:1 */
:root {
    --oneri-zemin: #e8f5e9;
    --oneri-girdi: #f1f8f2;
    --oneri-kenar: #2e7d32;
    --oneri-murekkep: #1b5e20;
    --oneri-soluk: #3d7a43;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: #f0f2f5;
    color: #222;
    font-size: 15px;
}

.topbar {
    background: #4a1d6b;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1 { font-size: 17px; font-weight: 600; }

.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav a, .date-nav span {
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,.15);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.date-nav span { background: rgba(255,255,255,.3); font-weight: 600; }

.container { max-width: 720px; margin: 0 auto; padding: 12px; }

/* Özet kartları */
.summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
@media (max-width: 480px) {
    .summary {
        grid-template-columns: repeat(2, 1fr);
    }
}
.card {
    background: #fff;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.card .label { font-size: 11px; color: #777; text-transform: uppercase; letter-spacing: .5px; }
.card .value { font-size: 20px; font-weight: 700; margin-top: 4px; }
.card.bread .value { color: #e67e22; }
.card.cash  .value { color: #27ae60; }
.card.irs   .value { color: #c0392b; }

/* Market satırları */
.market-row {
    background: #fff;
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}
.market-row.irsaliye { background: #fdecea; }

.m-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.m-total-inline {
    font-size: 13px;
    font-weight: 700;
    color: #27ae60;
    white-space: nowrap;
    min-width: 0;
}
.m-name {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}
.tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    white-space: nowrap;
}
.tag.tahsilat { background: #d5f5e3; color: #1e8449; }
.tag.irsaliye { background: #fadbd8; color: #b03a2e; }

.m-grid {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
    max-width: 100%;
    overflow: hidden;
}
.m-grid label {
    font-size: 12px;
    font-weight: 700;
    color: #4a1d6b;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.rec-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--oneri-zemin);
    color: var(--oneri-murekkep);
    font-size: 11px;
    font-weight: 700;
    min-width: 24px;
    height: 32px;
    border-radius: 6px;
    padding: 0 4px;
}
.m-grid input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 8px 4px;
    font-size: 16px;
    text-align: center;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    background: #fafafa;
    -moz-appearance: textfield;
    appearance: textfield;
}
.m-grid input:focus { border-color: #4a1d6b; outline: none; background: #fff; }
.m-grid input::placeholder { color: #aaa; }
.m-grid input:focus::placeholder { color: transparent; }

/* Tag tıklanabilir */
.tag {
    cursor: pointer;
    transition: all .2s;
    user-select: none;
}
.tag:hover {
    opacity: .85;
}
.tag.paid {
    background: #27ae60;
    color: #fff;
}
.market-row.paid-row {
    background: #eafaf1;
    border: 1.5px solid #27ae60;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    width: 300px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.modal p {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}
.modal-actions {
    display: flex;
    gap: 8px;
}
.modal-actions .btn {
    flex: 1;
}

/* Butonlar */
.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 14px 0;
}
.btn {
    display: block;
    text-align: center;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: #4a1d6b; color: #fff; }
.btn-print   { background: #e67e22; color: #fff; }
.btn-green   { background: #27ae60; color: #fff; }
.btn-gray    { background: #7f8c8d; color: #fff; }
.btn-block   { grid-column: 1 / -1; }

/* Masraf */
.expense-row {
    display: grid;
    grid-template-columns: 1fr 90px auto;
    gap: 6px;
    margin-bottom: 6px;
}
.expense-row input {
    padding: 10px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    width: 100%;
    min-width: 0;
}

/* Gün seçici — mobilde 4'lü eşit ızgara, geniş ekranda tek satır */
.day-selector {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 12px;
}
@media (min-width: 600px) {
    .day-selector { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
.day-btn {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 4px;
    background: #fff;
    color: #4a1d6b;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.day-btn.active {
    background: #4a1d6b;
    color: #fff;
    border-color: #4a1d6b;
}

/* Önerilen sayı inputları */
.rec-inputs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rec-row {
    display: flex;
    gap: 4px;
}
.rec-row label {
    font-size: 11px;
    font-weight: 700;
    color: #4a1d6b;
    min-width: 24px;
    text-align: right;
    white-space: nowrap;
}
.rec-row input {
    width: 100%;
    min-width: 0;
    padding: 6px 4px;
    font-size: 13px;
    text-align: center;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    -moz-appearance: textfield;
    appearance: textfield;
}
.rec-row input:focus { border-color: #4a1d6b; outline: none; }
.rec-row input::placeholder { color: #aaa; }
.rec-row input:focus::placeholder { color: transparent; }

/* Mobil/Masaüstü görünürlük */
.mobile-only { display: block; }
.desktop-only { display: none; }

/* Market kartları (mobil) */
.market-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.mc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.mc-name {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mc-type-select {
    padding: 6px 8px;
    min-height: 44px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    background: #fff;
    cursor: pointer;
    min-width: 90px;
}
.mc-type-select:focus { border-color: #4a1d6b; outline: none; }
.mc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}
.mc-field label {
    display: block;
    font-size: 11px;
    color: #777;
    margin-bottom: 3px;
}
.mc-field input {
    width: 100%;
    padding: 8px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    -moz-appearance: textfield;
    appearance: textfield;
}
.mc-field input:focus { border-color: #4a1d6b; outline: none; }
.mc-rec {
    margin-bottom: 10px;
}
.mc-rec label {
    display: block;
    font-size: 11px;
    color: #777;
    margin-bottom: 3px;
}
.mc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Market yönetimi */
table.admin {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    font-size: 14px;
}
table.admin th, table.admin td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
table.admin th { background: #4a1d6b; color: #fff; font-size: 12px; }
table.admin input[type="number"], table.admin input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}
table.admin select {
    padding: 8px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}
.del-btn { color: #c0392b; cursor: pointer; font-weight: 700; }

.notice {
    background: #d5f5e3;
    border: 1px solid #27ae60;
    color: #1e8449;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-weight: 600;
}

/* ===== A4 DİKEY RAPOR (report.php) — 29.09.2026 =====
   Ekranda: masa zemini üstünde 210mm kâğıt (masaüstü), telefonda tam genişlik + tablo yatay kaydırma kapsayıcısında
   (sayfa gövdesi kaymaz). Yazdırma/PDF: A4 dikey, 10mm kenar, siyah-beyaz yazıcıda okunur
   (renkli zemine güvenilmez: başlıklar koyu yazı + çizgi; renk yalnız ek ipucu). */
.rapor-body { background: #e4e0ea; color: #1d1a22; }

.rapor-arac {
    max-width: 210mm;
    margin: 0 auto;
    padding: 12px 12px 0;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.rapor-arac .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 18px;
    font-size: 15px;
}
.rapor-arac .btn .ph { margin-right: 0; }
/* Beyaz yazı kontrastı: turuncu 2.85 -> 4.98, gri 3.48 -> 5.51 (yalnız rapor araç çubuğu) */
.rapor-arac .btn-print { background: #b4540f; }
.rapor-arac .btn-gray { background: #5f6b6d; }

.a4-kagit {
    background: #fff;
    width: 100%;
    max-width: 210mm;
    margin: 12px auto 24px;
    padding: 16px 12px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(40,20,60,.10);
    font-variant-numeric: tabular-nums;
}
@media (min-width: 840px) {
    .a4-kagit { width: 210mm; min-height: 297mm; padding: 10mm; margin-top: 16px; }
}

/* Künye: firma + başlık solda, büyük tarih sağda, altında çift çizgi (imza öğe) */
.rapor-kunye {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 8px;
    border-bottom: 3px double #1d1a22;
}
.rk-firma {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #4a1d6b;
}
.rk-baslik { font-size: 20px; font-weight: 800; line-height: 1.15; margin-top: 2px; }
.rk-alt { font-size: 12px; font-weight: 600; color: #5c5766; letter-spacing: .04em; margin-left: 4px; }
.rk-sag { text-align: left; }
@media (min-width: 600px) { .rk-sag { text-align: right; } }
.rk-tarih { font-size: 24px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.rk-meta { font-size: 12px; color: #5c5766; margin-top: 4px; }

/* Özet şeridi: fatura toplamı gibi çizgili tek satır (renkli kart değil — s/b yazıcıda kaybolmaz) */
.rapor-ozet {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid #8f8a99;
    border-top: 0;
    margin: 0 0 12px;
}
.ro-hucre { padding: 7px 10px; border-top: 1px solid #8f8a99; }
.ro-hucre:nth-child(odd) { border-right: 1px solid #8f8a99; }
.ro-hucre dt { font-size: 11px; color: #5c5766; font-weight: 600; }
.ro-hucre dt small { font-weight: 400; font-size: inherit; }
.ro-hucre dd { font-size: 17px; font-weight: 800; margin-top: 1px; white-space: nowrap; }
.ro-hucre dd small { font-size: 11px; font-weight: 600; color: #5c5766; }
.ro-net { grid-column: 1 / -1; border-right: 0 !important; background: #f4f1f7; box-shadow: inset 3px 0 0 #4a1d6b; }
@media (min-width: 600px) {
    .rapor-ozet { grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid #8f8a99; }
    .ro-hucre { border-top: 0; border-right: 1px solid #8f8a99; }
    .ro-hucre:last-child { border-right: 0; }
    .ro-net { grid-column: auto; }
    .ro-hucre dd { font-size: 15px; }
}

.rapor-blok-baslik { font-size: 12px; font-weight: 700; margin: 12px 0 4px; color: #4a1d6b; }

/* Tablo kaydırma kapsayıcısı: yalnız tablo kayar, gövde değil */
.rapor-kaydir {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;
    padding: 0 12px;
}
.rapor-kaydir:focus-visible { outline: 2px solid #4a1d6b; outline-offset: 2px; }

table.report {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    border-top: 1px solid #8f8a99;
    border-left: 1px solid #8f8a99;
}
table.report th, table.report td {
    border-right: 1px solid #8f8a99;
    border-bottom: 1px solid #8f8a99;
    padding: 4px 3px;
    text-align: center;
    background: #fff;
}
table.report thead th {
    background: #f1ecf6;
    color: #1d1a22;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: normal;
    word-break: keep-all;
    vertical-align: bottom;
}
table.report th.t-grup { border-bottom: 2px solid #1d1a22; }
table.report th.t-sefer { font-weight: 700; font-size: 10px; }
/* Uzun ürün adı dar sütunda harf harf kırılmasın: dikey yazılır (aşağıdan yukarı okunur) */
table.report th.t-dik { vertical-align: bottom; padding: 5px 2px; }
table.report th.t-dik > span {
    display: inline-block;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    text-align: left;
    max-height: 34mm;
    overflow: hidden;
    text-overflow: ellipsis;
}
table.report td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.report td.sifir { color: #9a96a3; }
table.report td.no { color: #5c5766; font-size: 11px; }
table.report td.name, table.report th.t-market { text-align: left; font-weight: 600; padding-left: 5px; }
table.report td.name { overflow-wrap: anywhere; }
table.report .toplam, table.report th.t-toplam { border-left: 2px solid #1d1a22; font-weight: 800; }
table.report td.tahsilat { text-align: right; font-weight: 700; padding-right: 5px; }
table.report tr.irsaliye td { background: #fdf3f2; }
table.report tr.irsaliye td.name, table.report td.irs-cell { color: #9b2c22; }
table.report td.irs-cell { font-style: italic; font-weight: 700; font-size: 10px; letter-spacing: .03em; }
table.report tfoot td {
    background: #f1ecf6;
    font-weight: 800;
    border-top: 2px solid #1d1a22;
}

/* Telefon/tablet: doğal genişlik + yapışkan market sütunu (kaydırırken hangi satır görünür) */
@media (max-width: 839px) {
    table.report { width: auto; min-width: 100%; }
    table.report td.num { min-width: 30px; }
    table.report td.tahsilat { min-width: 88px; }
    table.report td.name, table.report th.t-market {
        position: sticky;
        left: 0;
        z-index: 1;
        min-width: 112px;
        max-width: 140px;
        box-shadow: 1px 0 0 #8f8a99;
    }
    table.report thead th.t-market { z-index: 2; }
    table.report tfoot td.name { position: static; }
}
/* Masaüstü ekran = kâğıt: sabit sütun düzeni (yazdırmayla aynı) */
@media (min-width: 840px) {
    .rapor-kaydir { margin: 0; padding: 0; }
    table.report { table-layout: fixed; }
    table.report col.c-no { width: 6mm; }
    table.report col.c-market { width: 34mm; }
    table.report col.c-toplam { width: 14mm; }
    table.report col.c-tahsilat { width: 22mm; }
}

/* Alt detay: masraf + irsaliyeli marketler */
.rapor-detay {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
}
@media (min-width: 600px) { .rapor-detay { grid-template-columns: 1fr 1fr; } }
.rd-kutu { border: 1px solid #8f8a99; padding: 8px 10px; break-inside: avoid; }
.rd-kutu h3 {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding-bottom: 5px;
    margin-bottom: 6px;
    border-bottom: 1px solid #8f8a99;
}
.rd-tablo { width: 100%; border-collapse: collapse; font-size: 13px; }
.rd-tablo td { padding: 3px 0; border-bottom: 1px dotted #8f8a99; }
.rd-tablo td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rd-tablo tr.rd-toplam td { font-weight: 800; border-bottom: 0; }
.rd-liste { font-size: 13px; line-height: 1.45; }
.rd-bos { font-size: 13px; color: #5c5766; }

/* ===== YAZDIRMA / PDF: A4 DİKEY ===== */
@page { size: A4 portrait; margin: 10mm; }
@media print {
    html, body { overflow: visible !important; }
    body, .rapor-body { background: #fff; padding: 0 !important; font-size: 8pt; color: #000; }
    .no-print, .bottom-nav, .rapor-arac, .save-status { display: none !important; }
    .container { max-width: none; padding: 0; }
    .topbar { display: none; }

    .a4-kagit { width: auto; max-width: none; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
    .rapor-kunye { border-bottom-color: #000; }
    .rk-firma { color: #000; font-size: 8pt; }
    .rk-baslik { font-size: 14pt; }
    .rk-alt, .rk-meta { font-size: 8pt; color: #333; }
    .rk-tarih { font-size: 16pt; }
    .rk-sag { text-align: right; }

    .rapor-ozet { grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid #000; margin-bottom: 4mm; }
    .ro-hucre { border-top: 0; border-right: 1px solid #000; padding: 1.5mm 2.5mm; }
    .ro-hucre:last-child { border-right: 0; }
    .ro-hucre dt, .ro-hucre dd small { font-size: 7.5pt; color: #333; }
    .ro-hucre dd { font-size: 11pt; }
    .ro-net { grid-column: auto; background: none; box-shadow: none; border-left: 2px solid #000; }

    .rapor-kaydir { overflow: visible; margin: 0; padding: 0; }
    .rapor-blok-baslik { color: #000; font-size: 8pt; margin: 3mm 0 1mm; }
    .rapor-blok-baslik.rb-sonraki { break-before: page; page-break-before: always; margin-top: 0; }
    table.report { table-layout: fixed; width: 100%; font-size: 8pt; border-color: #000; }
    table.report col.c-no { width: 6mm; }
    table.report col.c-market { width: 34mm; }
    table.report col.c-toplam { width: 14mm; }
    table.report col.c-tahsilat { width: 22mm; }
    table.report th, table.report td { border-color: #000; padding: .8mm .6mm; background: none; }
    table.report thead th { font-size: 7.5pt; background: none; border-bottom: 1.5px solid #000; }
    table.report th.t-sefer { font-size: 7.5pt; }
    table.report td.no { font-size: 7.5pt; color: #000; }
    table.report td.sifir { color: #666; }
    table.report td.irs-cell { font-size: 7.5pt; }
    table.report tr.irsaliye td { background: none; }
    table.report tr.irsaliye td.name, table.report td.irs-cell { color: #000; }
    table.report tfoot td { background: none; border-top: 2px solid #000; }
    table.report td.name, table.report th.t-market { position: static; box-shadow: none; }
    /* Başlık her sayfada, satır bölünmez, TOPLAM yalnız son sayfada (tfoot'u her sayfada tekrarlama) */
    table.report thead { display: table-header-group; }
    table.report tfoot { display: table-row-group; }
    table.report tr { break-inside: avoid; page-break-inside: avoid; }

    .rapor-detay { grid-template-columns: 1fr 1fr; margin-top: 4mm; gap: 3mm; }
    .rd-kutu { border-color: #000; padding: 2mm 3mm; }
    .rd-kutu h3 { font-size: 7.5pt; border-bottom-color: #000; }
    .rd-tablo, .rd-liste, .rd-bos { font-size: 8pt; color: #000; }
    .rd-tablo td { border-bottom-color: #666; }
}

/* Alt navigasyon (tüm sayfalarda) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 10px rgba(0,0,0,.1);
    z-index: 100;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 12px;
    flex: 1;
    min-height: 52px;
    justify-content: center;
    padding: 4px 0;
}
.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}
.nav-item.active {
    color: #4a1d6b;
    font-weight: 600;
}
body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

/* ===== Giriş ekranı ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 14px;
    padding: 28px 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.login-card h1 { font-size: 20px; color: #4a1d6b; text-align: center; margin-bottom: 4px; }
.login-card .login-sub { font-size: 13px; color: #777; text-align: center; margin-bottom: 20px; }
.login-card label { display: block; font-size: 13px; color: #555; margin: 12px 0 4px; font-weight: 600; }
.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    background: #fafafa;
}
.login-card input:focus { border-color: #4a1d6b; outline: none; background: #fff; }
.login-card .btn { width: 100%; margin-top: 20px; }
.login-error {
    background: #fdecea;
    color: #b03a2e;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
.login-info {
    background: #d5f5e3;
    color: #1e8449;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
.logout-form { display: inline; margin: 0; }
.logout-form button {
    color: #fff;
    background: rgba(255,255,255,.15);
    border: none;
    padding: 6px 12px;
    min-height: 44px;
    min-width: 44px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

/* ===== Ürün modeli (ürünler / market-ürün ataması) =====
   29.09.2026 düzeltmesi: şoför telefonda kullanıyor ->
   - tüm form alanları 16px (iOS Safari 16px altı alana odaklanınca sayfayı yakınlaştırıyordu)
   - dokunma hedefleri >= 44px (onay kutusu satırı, fiyat, öneri, bağlantı-butonlar, özet)
   - kayıt durumu akıştan çıkıp alt menünün üstünde "toast" oldu (8000px aşağıdaki kartta da görünür, kaydırma zıplaması yok) */
.ph { font-size: 1.1em; }
.btn .ph, .link-btn .ph { margin-right: 4px; }
.topbar h1 .ph { margin-right: 4px; }
.date-nav a .ph, .logout-form .ph { font-size: 16px; vertical-align: -2px; }

/* Klavye odağı görünür (dokunmada çıkmaz) */
a:focus-visible, button:focus-visible, summary:focus-visible, .mp-check:focus-within {
    outline: 2px solid #4a1d6b;
    outline-offset: 2px;
}
.topbar a:focus-visible, .topbar button:focus-visible { outline-color: #fff; }

.p-head {
    font-size: 12px;
    font-weight: 700;
    color: #4a1d6b;
    margin: 4px 0 4px;
    letter-spacing: .3px;
}
.p-empty {
    font-size: 13px;
    color: #666;
    background: #f7f7f9;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 6px;
}
.p-empty a { color: #4a1d6b; font-weight: 600; }

/* Kayıt durumu: sabit toast (boşken görünmez, yer kaplamaz) */
.save-status {
    position: fixed;
    left: 50%;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 101;
    max-width: calc(100% - 32px);
    padding: 10px 18px;
    border-radius: 999px;
    background: #1e8449;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    pointer-events: none;
    transition: opacity .2s ease;
}
.save-status:empty { opacity: 0; padding: 0; box-shadow: none; }
.save-status.is-error { background: #b03a2e; }
@media (prefers-reduced-motion: reduce) {
    .save-status { transition: none; }
}

.notice-error { background: #fdecea; border-color: #c0392b; color: #b03a2e; }
.notice .ph { vertical-align: -2px; }
.hint { font-size: 13px; color: #595959; margin: 0 0 12px; line-height: 1.45; }
.small-label { display: block; font-size: 12px; color: #666; margin-bottom: 3px; }

.panel-form {
    background: #fff;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.panel-form h3 { margin-bottom: 10px; font-size: 15px; }
/* Mobil: 2 sütun; ilk alan (ad) ve Ekle butonu tam satır, arada tek kalan alan da tam satır */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}
.form-grid > div:first-child,
.form-grid > div:nth-child(2):nth-last-child(2),
.form-grid > .btn { grid-column: 1 / -1; }
@media (min-width: 600px) {
    .form-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .form-grid > div:first-child,
    .form-grid > div:nth-child(2):nth-last-child(2),
    .form-grid > .btn { grid-column: auto; }
}
.form-grid label { display: block; font-size: 12px; color: #666; margin-bottom: 3px; }
.form-grid input, .form-grid select {
    width: 100%;
    min-height: 44px;
    padding: 10px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    background: #fafafa;
    font-family: inherit;
}
.form-grid input:focus, .form-grid select:focus { border-color: #4a1d6b; outline: none; background: #fff; }
.form-grid .btn { min-height: 44px; padding: 11px 16px; font-size: 15px; }

.link-btn {
    background: none;
    border: none;
    color: #4a1d6b;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    min-height: 44px;
    padding: 6px 0;
    display: inline-flex;
    align-items: center;
    font-family: inherit;
}
.link-btn.del-btn { color: #c0392b; }
.del-form { display: inline; margin: 0; }

.is-passive { opacity: .6; }

/* Market kartı başlığı: düzenlenebilir ad (alt çizgi ipucu) */
.mc-name-input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    font-size: 16px;
    font-weight: 700;
    color: #4a1d6b;
    border: 1.5px solid transparent;
    border-bottom-color: #d9c7e8;
    border-radius: 6px;
    padding: 6px;
    background: transparent;
    font-family: inherit;
}
.mc-name-input:focus { border-color: #4a1d6b; outline: none; background: #fff; }
.sort-input {
    width: 84px;
    min-height: 44px;
    padding: 6px 8px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}
.sort-input:focus { border-color: #4a1d6b; outline: none; }

/* Market-ürün satırı: [x] Ad | fiyat | öneriler */
.mp-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.mp-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 6px 8px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f7f7f9;
    border: 1px solid #ececf1;
}
.mp-row.on { background: #f3ecf8; border-color: #d9c7e8; }
/* Etiketin tamamı dokunma hedefi (kutu + ad) */
.mp-check { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; min-height: 44px; }
.mp-check input { width: 22px; height: 22px; accent-color: #4a1d6b; flex: none; }
/* Uzun market adı kesilmez: en fazla 2 satır */
.mp-name {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.25;
    overflow: hidden;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}
.mp-name small { font-weight: 400; color: #666; }
.mp-price, .mp-rec input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px 6px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    background: #fff;
    font-family: inherit;
    -moz-appearance: textfield;
    appearance: textfield;
}
/* Yer tutucu (= varsayılan fiyat) girilmiş değerle karışmasın */
.mp-price::placeholder { color: #6e6e7a; font-style: italic; }
.mp-price:focus { border-color: #4a1d6b; outline: none; }
.mp-price:focus::placeholder, .mp-rec input:focus::placeholder { color: transparent; }

/* Öneri bölümü — fiyattan ayrı renk (yeşil aile) + ampul ikonu + "Öneri" etiketi (renk körlüğü için) */
.mp-rec {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    margin: 0 -2px;
    border-radius: 8px;
    background: var(--oneri-zemin);
    border: 1px dashed var(--oneri-kenar);
}
.mp-row:not(.on) .mp-rec { display: none; }
.mp-rec-etiket {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--oneri-murekkep);
    padding: 0 4px;
    white-space: nowrap;
}
.mp-rec-etiket .ph { font-size: 17px; }
.mp-rec input {
    background: var(--oneri-girdi);
    border-color: var(--oneri-kenar);
    color: var(--oneri-murekkep);
    font-weight: 700;
}
.mp-rec input::placeholder { color: var(--oneri-soluk); font-weight: 400; font-style: normal; }
.mp-rec input:focus { border-color: var(--oneri-murekkep); box-shadow: 0 0 0 2px rgba(46,125,50,.25); outline: none; background: #fff; }

/* Ürün kartı */
.product-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    scroll-margin-top: 72px;
}
.market-card { scroll-margin-top: 72px; }
.pc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pc-name {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    font-size: 17px;
    font-weight: 700;
    color: #4a1d6b;
    padding: 6px 10px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
}
.pc-name:focus { border-color: #4a1d6b; outline: none; }
.pc-count { font-size: 13px; color: #666; white-space: nowrap; }
.pc-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
}
.pc-fields input {
    width: 100%;
    min-height: 44px;
    padding: 8px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}
.pc-fields input:focus { border-color: #4a1d6b; outline: none; }
.pc-toggle { grid-column: 1 / -1; }
.pc-markets { margin-top: 4px; border-top: 1px solid #eee; }
.pc-markets summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: #4a1d6b;
    line-height: 18px;
    padding: 13px 0;
    list-style-position: inside;
}

@media (min-width: 720px) {
    .mp-row { grid-template-columns: minmax(0, 1.2fr) 120px minmax(0, 2fr); }
    .mp-rec { grid-column: auto; }
    .pc-fields { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
    .pc-toggle { grid-column: auto; }
}
