* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Space Grotesk", sans-serif;
    background: #e8e0d0;
    color: #1a1a2e;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

#kagit {
    background: #fff;
    width: 100%;
    max-width: 800px;
    border: 3px solid #1a1a2e;
    box-shadow: 8px 8px 0 #1a1a2e;
    padding: 40px;
}
#logoAlan {
    text-align: center;
    margin-bottom: 24px;
}
#logoLabel {
    display: inline-block;
    cursor: pointer;
}
#logoSarmal {
    position: relative;
    display: none;
    text-align: center;
}
#logoResim {
    max-height: 90px;
    max-width: 240px;
    object-fit: contain;
}
#logoSil {
    position: absolute;
    top: -10px;
    right: 50%;
    margin-right: -130px;
    background: #c0392b;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
#logoYazi {
    display: inline-block;
    border: 2px dashed #999;
    color: #999;
    font-family: "Space Mono", monospace;
    font-size: 13px;
    padding: 20px 40px;
    letter-spacing: 1px;
    transition: all 0.15s;
}
#logoYazi:hover {
    border-color: #1a1a2e;
    color: #1a1a2e;
}

/* Üst kısım */
#ust {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid #1a1a2e;
    padding-bottom: 24px;
    margin-bottom: 32px;
}
#etiket {
    display: inline-block;
    background: #1a1a2e;
    color: #e8e0d0;
    font-family: "Space Mono", monospace;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
#firmaAd {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
}

#firmaIletisim {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
#firmaIletisim input {
    border: none;
    font-family: "Space Mono", monospace;
    font-size: 13px;
    color: #555;
    padding: 2px 0;
    background: transparent;
    width: 260px;
}
#firmaIletisim input:focus {
    outline: none;
    color: #1a1a2e;
    background: #fff8f0;
}
#tarihAlan { text-align: right; }
#tarihAlan label {
    display: block;
    font-family: "Space Mono", monospace;
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
#tarih {
    border: 2px solid #1a1a2e;
    padding: 8px;
    font-family: "Space Mono", monospace;
    font-size: 14px;
    background: #fff;
}

#teklifNo {
    border: 2px solid #1a1a2e;
    padding: 8px;
    font-family: "Space Mono", monospace;
    font-size: 14px;
    background: #fff;
    text-align: right;
    width: 140px;
}
#musteriAlan {
    margin-bottom: 32px;
}
#musteriAlan label {
    display: block;
    font-family: "Space Mono", monospace;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
#musteri {
    width: 100%;
    border: 2px solid #1a1a2e;
    padding: 12px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 16px;
}

/* Tablo */
#tablo {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
#tablo th {
    font-family: "Space Mono", monospace;
    font-size: 12px;
    text-align: right;
    padding: 10px 8px;
    border-bottom: 2px solid #1a1a2e;
    letter-spacing: 1px;
}
#tablo th.sol { text-align: left; }
#tablo td {
    padding: 8px;
    border-bottom: 1px solid #ccc;
}
#tablo input {
    width: 100%;
    border: none;
    font-family: "Space Grotesk", sans-serif;
    font-size: 15px;
    padding: 6px;
    background: transparent;
}
#tablo input:focus { outline: 2px solid #E67E22; background: #fff8f0; }
.hucre-sag input { text-align: right; }
.hucre-toplam {
    text-align: right;
    font-family: "Space Mono", monospace;
    font-weight: 700;
    white-space: nowrap;
}
.sil-btn {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 18px;
    cursor: pointer;
    font-weight: 700;
}

/* Ekle butonu */
#ekleBtn {
    background: #fff;
    border: 2px solid #1a1a2e;
    padding: 10px 20px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 32px;
    transition: all 0.15s;
}
#ekleBtn:hover { background: #1a1a2e; color: #fff; }

/* Özet */
#ozet {
    border: 3px solid #1a1a2e;
    padding: 20px 24px;
    margin-bottom: 32px;
    background: #f7f3ea;
}
.ozet-satir {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-family: "Space Mono", monospace;
    font-size: 15px;
}
.ozet-satir input {
    width: 80px;
    border: 2px solid #1a1a2e;
    padding: 4px 8px;
    text-align: right;
    font-family: "Space Mono", monospace;
    font-size: 15px;
}
.ozet-satir.buyuk {
    border-top: 2px solid #1a1a2e;
    margin-top: 8px;
    padding-top: 16px;
    font-size: 24px;
    font-weight: 700;
}

/* Not */
#gecerlilikAlan { margin-bottom: 24px; }
#gecerlilikAlan label {
    display: block;
    font-family: "Space Mono", monospace;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
#gecerlilik {
    border: 2px solid #1a1a2e;
    padding: 10px;
    font-family: "Space Mono", monospace;
    font-size: 14px;
    background: #fff;
}
#notAlan { margin-bottom: 32px; }
#notAlan label {
    display: block;
    font-family: "Space Mono", monospace;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
#notlar {
    width: 100%;
    min-height: 80px;
    border: 2px solid #1a1a2e;
    padding: 12px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 14px;
    resize: vertical;
}

/* Kaydet */
#kaydetBtn {
    width: 100%;
    background: #1a1a2e;
    color: #fff;
    border: 3px solid #1a1a2e;
    box-shadow: 5px 5px 0 #E67E22;
    padding: 18px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s;
}
#kaydetBtn:hover { box-shadow: 2px 2px 0 #E67E22; transform: translate(3px, 3px); }

#pdfBtn {
    width: 100%;
    background: #E67E22;
    color: #1a1a2e;
    border: 3px solid #1a1a2e;
    box-shadow: 5px 5px 0 #1a1a2e;
    padding: 18px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.15s;
}
#pdfBtn:hover { box-shadow: 2px 2px 0 #1a1a2e; transform: translate(3px, 3px); }

#temizleBtn {
    width: 100%;
    background: #fff;
    color: #c0392b;
    border: 2px solid #c0392b;
    padding: 14px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.15s;
}
#temizleBtn:hover { background: #c0392b; color: #fff; }

@media print {
    body { background: #fff; padding: 0; }
    #kagit { border: none; box-shadow: none; max-width: 100%; padding: 20px; }

    /* Ekranda gerekli ama çıktıda gereksiz olanları gizle */
    #ekleBtn, .sil-btn, #kaydetBtn, #pdfBtn, #temizleBtn, #logoLabel, #logoSil { display: none !important; }
    th:last-child, td:last-child { display: none; } /* sil sütunu */

    /* Input'ları düz yazıya çevir (kutu görünmesin) */
    input, textarea {
        border: none !important;
        outline: none !important;
        background: transparent !important;
        -webkit-appearance: none;
        appearance: none;
        padding: 2px !important;
        
    }

    /* Tarih ve yüzde kutuları çıktıda çerçevesiz */
    #tarih, .ozet-satir input { border: none !important; }

    /* Notlar boşsa yer kaplamasın diye normal görünsün */
    #notlar { min-height: auto; }

    /* Renkler baskıda korunsun */
    #etiket, #kaydetBtn { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

        /* Satırlar ve bloklar iki sayfaya bölünmesin */
        tr { break-inside: avoid; }
        #ozet, #notAlan, #ust { break-inside: avoid; }
        #kaydetBtn, #pdfBtn, #temizleBtn { break-inside: avoid; }

        .ekranNot { display: none; }
}

/* ---- MOBİL UYUM ---- */
@media (max-width: 640px) {
    body { padding: 12px; }

    #kagit {
        padding: 20px;
        box-shadow: 4px 4px 0 #1a1a2e;
    }

    /* Üst kısım alt alta insin */
    #ust {
        flex-direction: column;
        gap: 20px;
    }
    #tarihAlan { text-align: left; }
    #teklifNo { width: 100%; }

    #firmaAd { font-size: 26px; }
    #firmaIletisim input { width: 100%; }

    /* Özet kutusu */
    #ozet { padding: 16px; }
    .ozet-satir { font-size: 14px; }
    .ozet-satir.buyuk { font-size: 20px; }

    /* Butonlar dokunmatik için rahat */
    #kaydetBtn, #pdfBtn, #temizleBtn {
        padding: 16px;
        font-size: 16px;
    }
    #ekleBtn {
        width: 100%;
        padding: 14px;
    }
        /* Tablo dar ekranda yatay kaydırılabilsin */
        #tablo {
            display: block;
            overflow-x: auto;
            white-space: nowrap;
        }
        #tablo thead, #tablo tbody, #tablo tr {
            display: table;
            width: 100%;
            table-layout: fixed;
        }
        #tablo input { font-size: 14px; }

        #tablo th {
            font-size: 10px;
            padding: 8px 4px;
            letter-spacing: 0;
        }
        #tablo td { padding: 6px 4px; }
}