html, body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    margin: 0;
}

/* tło widoczne zanim załaduje się MudBlazor (bez błysku w trybie ciemnym) */
body { background: var(--ei-bg); color: var(--ei-text); }

.ei-nav-group { opacity: .65; letter-spacing: .08em; }
.ei-appbar { border-bottom: 1px solid rgba(128, 128, 128, .25); }
.ei-drawer { border-right: 1px solid rgba(128, 128, 128, .25); }
.ei-drawer .mud-drawer-content { display: flex; flex-direction: column; }
.ei-wersja { margin-top: auto; padding: 12px 16px; font-size: .72rem; line-height: 1.4; opacity: .6; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    color: #1b2333;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1rem;
    color: white;
}
.blazor-error-boundary::after { content: "Wystąpił błąd." }

/* karty z kwotami, podglądy */
.ei-money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ei-paper { background: #fff; color: #1b2333; border-radius: 6px; box-shadow: 0 2px 14px rgba(0, 0, 0, .18); }

/* ---------- podgląd faktury (kartka) ---------- */
.ei-doc { padding: 28px 30px; font-size: .78rem; line-height: 1.45; color: #1b2333; }
.ei-doc b { font-weight: 600; }
.ei-doc-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #1f6feb; padding-bottom: 12px; margin-bottom: 14px; }
.ei-doc-title { font-size: 1.1rem; font-weight: 700; color: #1f6feb; }
.ei-doc-number { font-size: 1.3rem; font-weight: 700; }
.ei-doc-sub { color: #64708a; font-size: .74rem; }
.ei-doc-dates { text-align: right; }
.ei-doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 14px; }
.ei-doc-label { text-transform: uppercase; letter-spacing: .06em; font-size: .66rem; color: #64708a; margin: 12px 0 4px; }
.ei-doc-parties .ei-doc-label { margin-top: 0; }
.ei-doc-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.ei-doc-table th { background: #f0f3fa; font-weight: 600; font-size: .68rem; text-align: center; padding: 5px 4px; border: 1px solid #d9deea; }
.ei-doc-table td { padding: 5px 4px; border: 1px solid #d9deea; text-align: center; }
.ei-doc-table .l { text-align: left; }
.ei-doc-table .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ei-doc-sum { width: 60%; margin-left: auto; }
.ei-doc-sum .total td { font-weight: 700; background: #f7f9fd; }
.ei-doc-total { margin-top: 12px; padding: 10px 12px; background: #f0f6ff; border-radius: 6px; }
.ei-doc-total > div:first-child { display: flex; justify-content: space-between; font-size: 1rem; }
.ei-doc-words { color: #64708a; margin-top: 2px; }
.ei-doc-foot { margin-top: 14px; color: #1b2333; }

@media (max-width: 600px) {
    .ei-doc { padding: 16px; font-size: .7rem; }
    .ei-doc-parties { grid-template-columns: 1fr; }
    .ei-doc-head { flex-direction: column; }
    .ei-doc-dates { text-align: left; }
    .ei-doc-sum { width: 100%; }
}

.ei-sticky { position: sticky; top: 76px; }
.ei-preview-scroll { max-height: calc(100vh - 150px); overflow: auto; }

.ei-tile { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.ei-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.ei-panels .mud-expand-panel { border: 1px solid rgba(128,128,128,.3); border-radius: 10px; }

.ei-wybrany { border-color: var(--mud-palette-primary) !important; box-shadow: 0 0 0 2px var(--mud-palette-primary); }

.ei-wiersz { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid rgba(128,128,128,.2); }
.ei-wiersz:hover { background: rgba(128,128,128,.08); }
.ei-wiersz-aktywny { background: rgba(31,111,235,.12); }

.ei-doc-scroll { overflow-x: auto; margin-bottom: 4px; }
.ei-doc-table th, .ei-doc-table td { font-size: .68rem; padding: 4px 3px; }
.ei-doc-table th { white-space: nowrap; }
