/* ============================================================
   Entegre Fatura Servisi — modern kurumsal tema
   Marka renkleri: turkuaz-mavi + turuncu vurgu (light, corporate)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Marka */
    --brand-blue: #0a9cd6;      /* logo turkuaz-mavi */
    --brand-blue-dark: #0b7bb0;
    --brand-navy: #12293f;      /* koyu lacivert metin */
    --brand-orange: #ee5a24;    /* logo turuncu-kırmızı vurgu */

    /* Yüzeyler */
    --bg: #eaf1f6;
    --surface: #ffffff;
    --surface-muted: #f4f7fa;
    --border: #dbe4ec;
    --text: #12293f;
    --text-muted: #5b7183;

    /* Sistem */
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(18, 41, 63, .06);
    --shadow-md: 0 10px 30px -12px rgba(18, 41, 63, .25);
    --header-h: 64px;
    --footer-h: 46px;
    --gap: 18px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    /* Dış (sayfa) kaydırma çubuğunu engelle — yalnızca fatura kendi içinde kaysın */
    overflow: hidden;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        linear-gradient(180deg, rgba(10, 156, 214, .07), rgba(10, 156, 214, 0) 220px),
        url('/images/pattern.png');
    background-repeat: no-repeat, repeat;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.page {
    height: 100dvh;          /* tam ekran yüksekliği — sabit, taşma yok */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ---------- Üst çubuk ---------- */
.appbar {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 clamp(14px, 4vw, 28px);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.appbar__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    min-width: 0;
}

.appbar__logo {
    height: 34px;
    width: auto;
    display: block;
}

.appbar__divider {
    width: 1px;
    height: 26px;
    background: var(--border);
    flex: none;
}

.appbar__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-navy);
    letter-spacing: .1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar__title small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.appbar__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    min-width: 40px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--brand-navy);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.btn:hover { background: var(--surface-muted); border-color: #c6d4df; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(10, 156, 214, .4); outline-offset: 2px; }

.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(10, 156, 214, .8);
}
.btn--primary:hover { background: var(--brand-blue-dark); border-color: var(--brand-blue-dark); }

.btn--icon { padding: 0; }

/* Küçük ekranda buton yazılarını gizle, ikon kalsın */
@media (max-width: 640px) {
    .btn__label { display: none; }
    .btn { padding: 0; width: 40px; }
    .appbar__title small { display: none; }
}

/* ---------- İçerik / fatura kartı ---------- */
.main {
    flex: 1;
    display: flex;
    padding: var(--gap);
    min-height: 0;
    overflow: hidden;
}

.invoice-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.invoice-card__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.invoice-card__dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #2bb673; flex: none;
    box-shadow: 0 0 0 3px rgba(43, 182, 115, .18);
}

.invoice-frame {
    flex: 1;
    width: 100%;
    border: 0;
    display: block;
    background: #fff;
    min-height: 0;
}

/* Yükleniyor katmanı */
.loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--surface);
    color: var(--text-muted);
    z-index: 5;
    transition: opacity .4s ease, visibility .4s ease;
}
.loader.is-hidden { opacity: 0; visibility: hidden; }

.spinner {
    width: 38px; height: 38px;
    border: 3px solid var(--border);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Boş / bulunamadı durumu ---------- */
.empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap);
    min-height: 0;
    overflow: auto;   /* çok kısa ekranda kart kırpılmasın */
}

.empty__card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 40px 32px;
    text-align: center;
}

.empty__icon {
    width: 64px; height: 64px;
    margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(238, 90, 36, .1);
    color: var(--brand-orange);
}
.empty__icon svg { width: 32px; height: 32px; }

.empty__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: var(--brand-navy);
}

.empty__text {
    margin: 0 0 24px;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-muted);
}

.empty__countdown { font-weight: 600; color: var(--brand-navy); }

/* ---------- Alt bilgi ---------- */
.footer {
    min-height: var(--footer-h);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
}
.footer a { color: var(--brand-blue-dark); text-decoration: none; font-weight: 500; }
.footer a:hover { text-decoration: underline; }

/* ---------- Erişilebilirlik ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .spinner { border-top-color: var(--brand-blue); }
}
