@font-face {
    font-family: "Fira Sans Condensed";
    src: url("fonts/FiraSansCondensed-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Fira Sans Condensed";
    src: url("fonts/FiraSansCondensed-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Fira Sans Condensed";
    src: url("fonts/FiraSansCondensed-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Fira Sans Condensed";
    src: url("fonts/FiraSansCondensed-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --pw-ink: #08332e;
    --pw-muted: #5d756d;
    --pw-accent: #1daa61;
    --pw-accent-deep: #0f7a49;
    --pw-paper: #f3f6f4;
    --pw-line: #d5e3dc;
    --pw-header: #0d4f45;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
    font-family: "Fira Sans Condensed", sans-serif;
    font-size: 16.5px;
    font-weight: 700;
    color: var(--pw-ink);
    background: var(--pw-paper);
}

button, input, textarea, select {
    font-family: inherit;
    font-weight: 700;
}

body *:not(.bi):not([class^="bi-"]):not([class*=" bi-"]) {
    font-weight: 700;
}

a { color: var(--pw-accent-deep); }
.text-danger { color: #9b2335; }

h1:focus { outline: none; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.page-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.1;
}

.page-sub {
    margin: 0.2rem 0 0;
    color: var(--pw-muted);
    font-size: 0.86rem;
    max-width: 46rem;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.row-actions { display: inline-flex; gap: 0.25rem; }

.row-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pw-header);
    background: #e7f3ef;
    border: 1px solid var(--pw-line);
    padding: 0.18rem 0.45rem;
    font-variant-numeric: tabular-nums;
}

.btn {
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 0.15rem;
    border: 1px solid var(--pw-accent-deep);
    background: #fff;
    color: var(--pw-accent-deep);
    padding: 0.32rem 0.65rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    line-height: 1.2;
}

.btn:hover { background: #e7f6ef; }

.btn-primary { background: var(--pw-accent-deep); color: #fff; }
.btn-primary:hover { background: #0c6340; color: #fff; }

.btn-sm { font-size: 0.75rem; padding: 0.18rem 0.45rem; }

.btn-danger { border-color: #9b2335; color: #9b2335; background: #fff; }
.btn-danger:hover { background: #9b2335; color: #fff; }

.btn-ghost { border-color: #c5d8d0; color: var(--pw-ink); background: #fff; }
.btn-ghost:hover { background: #f3faf6; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 0.22rem; min-width: 0; }
.field-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #3d5c54;
}
.control, textarea.control {
    width: 100%;
    border: 1px solid #c5d8d0;
    border-radius: 0.15rem;
    background: #fff;
    color: var(--pw-ink);
    font: inherit;
    font-size: 0.8125rem;
    padding: 0.32rem 0.45rem;
}
textarea.control { min-height: 6.5rem; resize: vertical; }
.control:focus { outline: 2px solid rgba(29, 170, 97, 0.35); border-color: var(--pw-accent-deep); }

.form-error {
    background: #fff1f0;
    color: #8d2433;
    border: 1px solid #f0c2c4;
    padding: 0.4rem 0.55rem;
    font-size: 0.82rem;
}

.note {
    background: #e7f6ef;
    color: #0c6340;
    border: 1px solid #b7e4cc;
    padding: 0.4rem 0.55rem;
    font-size: 0.82rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    white-space: nowrap;
}
.pill-ok { background: #e5f8ee; color: #0c6340; }
.pill-bad { background: #fde8e8; color: #9b2335; }
.pill-wait { background: #fff4d8; color: #8a5a12; }
.pill-info { background: #e7f1fb; color: #1d4e89; }
.pill-muted { background: #eef1f0; color: #4d5e58; }

.modal-back {
    position: fixed;
    inset: 0;
    background: rgba(7, 40, 36, 0.46);
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.modal-card {
    width: min(34rem, 100%);
    background: #fff;
    border: 1px solid var(--pw-line);
    box-shadow: 0 18px 50px rgba(7, 40, 36, 0.22);
    padding: 1rem 1rem 0.9rem;
}

.modal-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.modal-card p { margin: 0 0 0.8rem; color: #34564e; font-size: 0.9rem; }

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-top: 0.9rem;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
}

.mono {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.78rem;
}

article.content:has(.wa-app) {
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.blazor-error-boundary {
    background: #9b2335;
    padding: 1rem 1rem 1rem 1rem;
    color: white;
}

#blazor-error-ui {
    background: #fff8d6;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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;
}

@media (max-width: 720px) {
    .modal-grid { grid-template-columns: 1fr; }
}
