/* Admin — Faturalama & fatura önizleme */

.bill-page {
    max-width: 1400px;
}

.bill-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.bill-kpi {
    flex: 1;
    min-width: 140px;
    padding: 16px 18px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.bill-kpi::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bill-kpi-accent, var(--accent));
}

.bill-kpi--warn::before { background: var(--amber); }
.bill-kpi--danger::before { background: var(--red); }

.bill-kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-4);
}

.bill-kpi-value {
    font-family: var(--display);
    font-size: 24px;
    font-weight: 700;
    margin-top: 6px;
    color: var(--text-0);
}

.bill-kpi--warn .bill-kpi-value { color: var(--amber); }
.bill-kpi--danger .bill-kpi-value { color: var(--red); }

.bill-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1100px) {
    .bill-layout { grid-template-columns: 1fr; }
}

.bill-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bill-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-1);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}

.bill-tab {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
}

.bill-tab.is-active {
    background: var(--accent-dim);
    color: var(--accent);
}

.bill-list {
    max-height: 520px;
    overflow-y: auto;
}

.bill-list-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
    cursor: pointer;
    font-family: var(--font);
    transition: background var(--transition);
}

.bill-list-item:hover { background: var(--bg-hover); }

.bill-list-item.is-selected {
    background: var(--accent-dim);
    border-left: 3px solid var(--accent);
    padding-left: 11px;
}

.bill-list-item-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-0);
}

.bill-list-item-sub {
    font-size: 11px;
    color: var(--text-4);
    margin-top: 2px;
}

.bill-list-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
}

.bill-preview-wrap {
    position: sticky;
    top: 16px;
}

.bill-preview-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

/* —— Fatura belgesi (kağıt) —— */
.inv-doc {
    background: #fafaf8;
    color: #1a1a1e;
    border-radius: 4px;
    box-shadow:
        0 1px 0 rgba(0, 0, 0, 0.06),
        0 24px 64px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    padding: 40px 44px 36px;
    font-size: 13px;
    line-height: 1.45;
    position: relative;
    overflow: hidden;
}

.inv-doc::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 70%, rgba(62, 255, 160, 0.03) 100%);
    pointer-events: none;
}

.inv-doc--incomplete::before {
    content: "ÖNİZLEME";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-18deg);
    font-family: var(--display);
    font-size: 56px;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: rgba(0, 0, 0, 0.04);
    pointer-events: none;
    z-index: 0;
}

.inv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #1a1a1e;
    position: relative;
    z-index: 1;
}

.inv-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inv-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d0f12 0%, #1a2e24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3effa0;
    font-family: var(--display);
    font-weight: 800;
    font-size: 18px;
}

.inv-brand-name {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #0d0f12;
    margin: 0;
}

.inv-brand-tag {
    font-size: 11px;
    color: #6b7280;
    margin: 2px 0 0;
}

.inv-meta-block {
    text-align: right;
}

.inv-type {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 4px;
}

.inv-number {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    color: #0d0f12;
    margin: 0;
}

.inv-dates {
    margin-top: 10px;
    font-size: 12px;
    color: #4b5563;
}

.inv-dates dt {
    display: inline;
    font-weight: 600;
    color: #6b7280;
}

.inv-dates dd {
    display: inline;
    margin: 0 0 0 6px;
}

.inv-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

@media (max-width: 600px) {
    .inv-parties { grid-template-columns: 1fr; }
}

.inv-party-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 8px;
}

.inv-party-name {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
}

.inv-party-lines {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: #4b5563;
}

.inv-party-lines li { margin-bottom: 3px; }

.inv-party-lines .inv-missing {
    color: #b45309;
    font-style: italic;
}

.inv-table-wrap {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.inv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.inv-table th {
    text-align: left;
    padding: 10px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
}

.inv-table th.num,
.inv-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.inv-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    vertical-align: top;
}

.inv-table tbody tr:last-child td { border-bottom: none; }

.inv-totals {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.inv-totals-box {
    min-width: 260px;
}

.inv-total-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 6px 0;
    font-size: 12px;
    color: #4b5563;
}

.inv-total-row--grand {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 2px solid #1a1a1e;
    font-size: 16px;
    font-weight: 700;
    color: #0d0f12;
}

.inv-total-row--grand span:last-child {
    font-family: var(--display);
    font-size: 20px;
}

.inv-footer {
    padding-top: 20px;
    border-top: 1px dashed #d1d5db;
    font-size: 11px;
    color: #6b7280;
    position: relative;
    z-index: 1;
}

.inv-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.inv-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.inv-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.inv-badge--ok {
    background: #ecfdf5;
    color: #047857;
}

.inv-badge--warn {
    background: #fffbeb;
    color: #b45309;
}

.inv-badge--muted {
    background: #f3f4f6;
    color: #4b5563;
}

.inv-alert {
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
    font-size: 12px;
    position: relative;
    z-index: 1;
}

.inv-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-4);
    background: var(--bg-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

@media print {
    body * { visibility: hidden; }
    .inv-doc, .inv-doc * { visibility: visible; }
    .inv-doc {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
    }
}
