/* Vergi Raporları — Beyanname Tablosu (KMT paneli, mobil uyumlu) */
html body .bt-root {
    --bt-ana: var(--emm-brand-primary, #003b95);
    --bt-ana-koyu: var(--emm-brand-primary-hover, #002d73);
    --bt-kenar: #e2e8f0;
    --bt-yazi: #0f172a;
    --bt-soluk: #64748b;
    --bt-eksik: #fde2e2;
    --bt-eksik-kenar: #f87171;
    --bt-eksik-yazi: #7f1d1d;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    color: var(--bt-yazi);
}

html body .bt-root *,
html body .bt-root *::before,
html body .bt-root *::after {
    box-sizing: border-box;
}

html body .bt-root .bt-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 0 16px;
    min-width: 0;
}

/* Araç çubuğu */
html body .bt-root .bt-toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--bt-kenar);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

html body .bt-root .bt-baslik {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

html body .bt-root .bt-baslik-ikon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 59, 149, 0.1);
    color: var(--bt-ana);
}

html body .bt-root .bt-toolbar h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

html body .bt-root .bt-toolbar p {
    margin: 2px 0 0;
    color: var(--bt-soluk);
    font-size: 0.82rem;
}

html body .bt-root .bt-filtreler {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 14px;
    align-items: flex-end;
}

html body .bt-root .bt-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 1 190px;
    min-width: 0;
    margin: 0;
}

html body .bt-root .bt-field.bt-grow {
    flex: 1 1 220px;
    max-width: 360px;
}

html body .bt-root .bt-donem {
    flex: 0 1 260px;
}

html body .bt-root .bt-field.bt-rapor-alan {
    flex: 0 0 auto;
}

html body .bt-root .bt-donem-secim {
    display: flex;
    gap: 8px;
}

html body .bt-root .bt-donem-secim .bt-input:first-child {
    flex: 1 1 auto;
}

html body .bt-root .bt-donem-secim .bt-input:last-child {
    flex: 0 0 96px;
}

html body .bt-root .bt-etiket {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--bt-soluk);
}

html body .bt-root .bt-zorunlu {
    color: #dc2626;
}

html body .bt-root .bt-input {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--bt-yazi);
    font-size: 0.9rem;
}

html body .bt-root .bt-input:focus {
    outline: none;
    border-color: var(--bt-ana);
    box-shadow: 0 0 0 3px rgba(0, 59, 149, 0.15);
}

html body .bt-root .bt-eylemler {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
}

html body .bt-root .bt-ayrac {
    flex: 1 1 auto;
}

html body .bt-root .bt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--bt-yazi);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

html body .bt-root .bt-btn:hover:not(:disabled) {
    border-color: var(--bt-ana);
    color: var(--bt-ana);
}

html body .bt-root .bt-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

html body .bt-root .bt-btn.birincil {
    background: var(--bt-ana);
    border-color: var(--bt-ana);
    color: #fff;
}

html body .bt-root .bt-btn.birincil:hover:not(:disabled) {
    background: var(--bt-ana-koyu);
    color: #fff;
}

html body .bt-root .bt-btn.kucuk {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 0.8rem;
}

html body .bt-root .bt-btn.kucuk.aktif {
    background: var(--bt-ana);
    border-color: var(--bt-ana);
    color: #fff;
}

html body .bt-root .bt-btn.ikon {
    width: 32px;
    padding: 0;
}

html body .bt-root .bt-btn.tehlike:hover:not(:disabled) {
    border-color: #dc2626;
    color: #dc2626;
}

html body .bt-root .bt-btn.tehlike-dolu {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

html body .bt-root .bt-not {
    margin: 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.82rem;
}

/* Uyarılar */
html body .bt-root .bt-uyari {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    border: 1px solid transparent;
}

html body .bt-root .bt-uyari.hata {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

html body .bt-root .bt-uyari.uyari {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

html body .bt-root .bt-uyari.bilgi {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

html body .bt-root .bt-bos {
    margin: 0;
    padding: 18px;
    text-align: center;
    color: var(--bt-soluk);
}

/* Tablo kartı */
html body .bt-root .bt-kart {
    background: #fff;
    border: 1px solid #d6e2f3;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 59, 149, 0.07), 0 1px 3px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    min-width: 0;
}

html body .bt-root .bt-kart-ust {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #d6e2f3;
    background: linear-gradient(180deg, #f7faff 0%, #eef4fc 100%);
    font-size: 0.84rem;
    color: #475569;
}

html body .bt-root .bt-kart-ust strong {
    color: var(--bt-ana);
}

html body .bt-root .bt-rapor-etiket {
    padding: 3px 11px;
    border-radius: 999px;
    background: var(--bt-ana);
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

html body .bt-root .bt-lejant {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

html body .bt-root .bt-kart-ara {
    flex: 0 1 280px;
    width: auto;
    min-height: 34px;
    padding: 5px 10px;
    font-size: 0.86rem;
    border-color: #c7d6ec;
}

html body .bt-root .bt-lejant-kutu {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

html body .bt-root .bt-lejant-kutu.eksik {
    background: var(--bt-eksik);
    border: 1px solid var(--bt-eksik-kenar);
}

html body .bt-root .bt-tablo-kap {
    width: 100%;
    overflow: auto;
    max-height: calc(100vh - 330px);
    min-height: 220px;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: #9fb6d9 #eef3fa;
}

html body .bt-root .bt-tablo-kap.kucuk {
    max-height: 50vh;
    min-height: 0;
    border: 1px solid #d6e2f3;
    border-radius: 10px;
}

html body .bt-root .bt-tablo {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.84rem;
}

html body .bt-root .bt-tablo th,
html body .bt-root .bt-tablo td {
    padding: 7px 8px;
    border-bottom: 1px solid #e3ebf6;
    border-right: 1px solid #e3ebf6;
    text-align: center;
    vertical-align: middle;
    background: #fff;
}

/* Başlık: marka mavisi */
html body .bt-root .bt-tablo thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 9px 8px;
    background: var(--emm-table-header-bg, var(--bt-ana));
    color: var(--emm-table-header-text, #fff);
    border-bottom: 2px solid var(--bt-ana-koyu);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    font-weight: 700;
    font-size: 0.76rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

html body .bt-root .bt-tablo thead th:last-child {
    border-right: 0;
}

html body .bt-root .bt-tablo .sola {
    text-align: left;
}

html body .bt-root .bt-th-metin {
    display: block;
    max-width: 130px;
    margin: 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

html body .bt-root .bt-th-kod {
    display: block;
    margin-top: 2px;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.7);
}

/* Ünvan sıralama düğmesi */
html body .bt-root .bt-sirala {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: left;
    cursor: pointer;
}

html body .bt-root .bt-sirala:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 3px;
    border-radius: 4px;
}

html body .bt-root .bt-sirala-ok {
    display: inline-flex;
    flex-direction: column;
    line-height: 0.55;
    font-size: 0.8rem;
}

html body .bt-root .bt-sirala-ok i {
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.15s ease;
}

html body .bt-root .bt-sirala-ok.artan .fa-caret-up,
html body .bt-root .bt-sirala-ok.azalan .fa-caret-down {
    color: #fff;
}

html body .bt-root .bt-sirala:hover .bt-sirala-ok i {
    color: rgba(255, 255, 255, 0.75);
}

html body .bt-root .bt-sirala:hover .bt-sirala-ok.artan .fa-caret-up,
html body .bt-root .bt-sirala:hover .bt-sirala-ok.azalan .fa-caret-down {
    color: #fff;
}

/* İlk iki sütun yatay kaydırmada sabit kalır */
html body .bt-root .bt-tablo .bt-sec {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 42px;
    min-width: 42px;
}

html body .bt-root .bt-tablo .bt-sec input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--bt-ana);
    cursor: pointer;
    vertical-align: middle;
}

html body .bt-root .bt-tablo .bt-unvan {
    position: sticky;
    left: 42px;
    z-index: 1;
    min-width: 220px;
    max-width: 320px;
    text-align: left;
    box-shadow: 3px 0 6px -3px rgba(0, 59, 149, 0.18);
}

html body .bt-root .bt-tablo thead .bt-sec,
html body .bt-root .bt-tablo thead .bt-unvan {
    z-index: 3;
}

html body .bt-root .bt-tablo tbody .bt-unvan {
    font-weight: 500;
    color: #1e293b;
}

/* Ünvan: tıklayınca kopyala (emm-grid-copy.js) */
html body .bt-root .bt-unvan-kopya {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 6px;
    vertical-align: middle;
    transition: background-color 0.15s ease, color 0.15s ease;
}

html body .bt-root .bt-unvan-kopya:hover {
    background: rgba(0, 59, 149, 0.08);
    color: var(--bt-ana);
}

html body .bt-root .bt-kopya-ikon {
    flex: 0 0 auto;
    font-size: 0.72rem;
    color: var(--bt-ana);
    opacity: 0;
    transition: opacity 0.15s ease;
}

html body .bt-root .bt-unvan-kopya:hover .bt-kopya-ikon,
html body .bt-root .bt-unvan-kopya:focus-visible .bt-kopya-ikon {
    opacity: 0.75;
}

html body .bt-root .bt-unvan-kopya.emm-copy-cell--active {
    position: relative;
}

html body .bt-root .bt-unvan-metin {
    display: inline-block;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

html body .bt-root .bt-pasif-rozet,
html body .bt-root .bt-standart-rozet {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    vertical-align: middle;
}

html body .bt-root .bt-pasif-rozet {
    background: #f1f5f9;
    color: var(--bt-soluk);
}

html body .bt-root .bt-standart-rozet {
    background: rgba(0, 59, 149, 0.08);
    color: var(--bt-ana);
}

/* Satırlar: zebra, üzerine gelince ve seçiliyken mavi tonlar */
html body .bt-root .bt-tablo tbody tr:nth-child(even) td {
    background: #f7faff;
}

html body .bt-root .bt-tablo tbody tr:hover td {
    background: #eaf2fe;
}

html body .bt-root .bt-tablo tbody tr.secili td {
    background: #e4eefc;
}

html body .bt-root .bt-tablo tbody tr.secili td.bt-sec {
    box-shadow: inset 3px 0 0 var(--bt-ana);
}

html body .bt-root .bt-tablo td.bt-hucre {
    min-width: 76px;
    white-space: nowrap;
}

/* Eksik hücre: açık kırmızı, mavi zebranın üzerinde de belirgin kalır */
html body .bt-root .bt-tablo tbody tr td.bt-hucre.eksik,
html body .bt-root .bt-tablo tbody tr.eksik td {
    background: var(--bt-eksik);
    color: var(--bt-eksik-yazi);
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.55);
}

html body .bt-root .bt-tablo tbody tr:hover td.bt-hucre.eksik,
html body .bt-root .bt-tablo tbody tr.eksik:hover td {
    background: #fbd5d5;
}

html body .bt-root .bt-belge {
    display: inline-flex;
    gap: 4px;
    margin: 1px 2px;
}

html body .bt-root .bt-ikon {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

html body .bt-root .bt-ikon.b {
    background: var(--bt-ana);
    border-color: var(--bt-ana);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 59, 149, 0.3);
}

html body .bt-root .bt-ikon.t {
    background: #fff;
    border-color: #4f86d6;
    color: var(--bt-ana);
}

html body .bt-root .bt-ikon:hover,
html body .bt-root .bt-ikon:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 59, 149, 0.28);
    outline: none;
}

html body .bt-root .bt-ikon.b:hover,
html body .bt-root .bt-ikon.b:focus-visible {
    background: var(--bt-ana-koyu);
}

html body .bt-root .bt-ikon.t:hover,
html body .bt-root .bt-ikon.t:focus-visible {
    background: #e8f0fc;
}

html body .bt-root .bt-tablo tbody tr.emm-copy-row--active td.bt-unvan {
    z-index: 4;
}


html body .bt-root .bt-eksik-metin {
    font-weight: 700;
}

html body .bt-root .bt-bos-satir {
    padding: 24px !important;
    color: var(--bt-soluk);
}

html body .bt-root .bt-sayfalama {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 14px;
    border-top: 1px solid var(--bt-kenar);
}

html body .bt-root .bt-sayfa-bilgi {
    margin-left: 6px;
    font-size: 0.8rem;
    color: var(--bt-soluk);
}

/* Modallar */
html body .bt-root .bt-modal-arka {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.45);
}

html body .bt-root .bt-modal {
    position: fixed;
    z-index: 1051;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(860px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

html body .bt-root .bt-modal-arka.ust {
    z-index: 1060;
}

html body .bt-root .bt-modal.ust {
    z-index: 1061;
}

html body .bt-root .bt-modal-baslik {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bt-kenar);
}

html body .bt-root .bt-modal-baslik h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html body .bt-root .bt-modal-eylem {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

html body .bt-root .bt-modal-govde {
    padding: 14px 16px 18px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

html body .bt-root .bt-pdf-modal {
    width: min(1100px, calc(100vw - 32px));
    height: calc(100vh - 48px);
}

html body .bt-root .bt-pdf-cerceve {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: #f1f5f9;
}

html body .bt-root .bt-olmayan-modal {
    width: min(1000px, calc(100vw - 32px));
}

html body .bt-root .bt-onay-modal {
    width: min(420px, calc(100vw - 32px));
}

html body .bt-root .bt-vergi-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 14px;
    align-items: flex-end;
}

html body .bt-root .bt-vergi-secim {
    flex: 2 1 320px;
}

html body .bt-root .bt-vergi-form-eylem {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

html body .bt-root .bt-alt-baslik {
    margin: 4px 0 0;
    font-size: 0.92rem;
    font-weight: 700;
}

html body .bt-root .bt-liste tr.pasif td {
    color: var(--bt-soluk);
    background: #f8fafc;
}

html body .bt-root .bt-islem {
    white-space: nowrap;
}

html body .bt-root .bt-islem .bt-btn + .bt-btn {
    margin-left: 6px;
}

/* Tablet */
@media (max-width: 991.98px) {
    html body .bt-root .bt-tablo-kap {
        max-height: none;
    }

    html body .bt-root .bt-ayrac {
        display: none;
    }
}

/* Telefon */
@media (max-width: 767.98px) {
    html body .bt-root .bt-toolbar {
        padding: 14px;
        border-radius: 12px;
    }

    html body .bt-root .bt-field,
    html body .bt-root .bt-field.bt-grow,
    html body .bt-root .bt-field.bt-rapor-alan,
    html body .bt-root .bt-donem {
        flex: 1 1 100%;
        max-width: none;
    }

    html body .bt-root .bt-eylemler .bt-btn {
        flex: 1 1 calc(50% - 10px);
        white-space: normal;
        text-align: center;
    }

    html body .bt-root .bt-lejant {
        margin-left: 0;
    }

    html body .bt-root .bt-kart-ara {
        flex: 1 1 100%;
    }

    html body .bt-root .bt-rapor-alan .bt-btn {
        width: 100%;
    }

    html body .bt-root .bt-tablo .bt-unvan {
        min-width: 150px;
        max-width: 180px;
    }

    html body .bt-root .bt-modal,
    html body .bt-root .bt-pdf-modal,
    html body .bt-root .bt-olmayan-modal {
        top: 0;
        left: 0;
        transform: none;
        width: 100vw;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    html body .bt-root .bt-onay-modal {
        top: auto;
        bottom: 0;
        height: auto;
        border-radius: 14px 14px 0 0;
    }

    html body .bt-root .bt-sayfalama {
        justify-content: center;
    }
}
