.app-body[class*="page-"] {
    background: radial-gradient(circle at 20% 15%, rgba(124, 58, 237, 0.12), transparent 35%),
        radial-gradient(circle at 80% 0%, rgba(16, 185, 129, 0.15), transparent 45%),
        var(--bg);
}

.app-topbar {
    background: var(--surface);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.navbar .nav-link {
    color: var(--ink);
    font-size: 14px;
}

.navbar .nav-link.active {
    color: var(--accent);
    font-weight: 600;
}

.navbar .nav-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

body[data-authenticated="0"] .auth-only {
    display: none !important;
}

body[data-authenticated="1"] .guest-only {
    display: none !important;
}

body:not([data-admin="1"]) .admin-only {
    display: none !important;
}

.user-label {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-main {
    padding: 0 0 96px;
}

.app-header {
    padding: 8px 0 12px;
}

.app-title {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.badge-chip {
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 600;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.panel {
    background: var(--surface);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(15, 23, 42, 0.08);
    height: 100%;
}

.panel h5 {
    font-weight: 700;
}

.hint {
    font-size: 12px;
    color: var(--muted);
}

.output {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    font-size: 12px;
    min-height: 100px;
    white-space: pre-wrap;
}

.form-floating > label {
    color: var(--muted);
    left: 8px;
    padding: 0.75rem 0.75rem;
    pointer-events: none;
    width: 100%;
}

.form-floating > .form-control,
.form-floating > .form-select {
    padding: 1rem 0.75rem 0.25rem;
}

.form-floating > textarea.form-control {
    height: auto;
    min-height: 120px;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-outline-primary {
    border-color: var(--accent);
    color: var(--accent);
}

.section-title {
    font-weight: 700;
    margin-bottom: 12px;
}

.divider {
    height: 1px;
    background: rgba(15, 23, 42, 0.08);
    margin: 16px 0;
}

.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    justify-content: space-around;
    padding: 8px 6px;
    z-index: 1030;
}

.app-bottom-nav .nav-link {
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.app-bottom-nav .nav-link i {
    font-size: 16px;
}

.app-bottom-nav .nav-link.active {
    color: var(--accent);
    font-weight: 600;
}

.app-bottom-nav .nav-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 24px 12px;
    border: 1px dashed rgba(15, 23, 42, 0.12);
    border-radius: 16px;
    display: grid;
    gap: 8px;
    place-items: center;
}

.empty-state i {
    font-size: 24px;
    color: var(--accent);
}

.app-loader { /* kontener pełnoekranowego loadera */
    position: fixed; /* pozycjonowanie względem okna przeglądarki */
    inset: 0; /* odległość od każdej krawędzi: top/right/bottom/left */
    background: #fff; /* kolor tła pod loaderem */
    display: flex; /* układ flex dla wyśrodkowania zawartości */
    align-items: center; /* wyrównanie w osi pionowej */
    justify-content: center; /* wyrównanie w osi poziomej */
    z-index: 1050; /* warstwa nad treścią */
    opacity: 0; /* przezroczystość startowa */
    visibility: hidden; /* ukrycie bez wpływu na layout */
    pointer-events: none; /* brak przechwytywania kliknięć gdy ukryty */
    transition: opacity 700ms ease, visibility 700ms ease; /* animacja przejścia widoczności */
}

.app-loader.is-active { /* stan: loader pokazany */
    opacity: 1; /* pełna widoczność */
    visibility: visible; /* element widoczny */
    pointer-events: all; /* blokuje kliknięcia w tle */
}

.app-loader.is-hiding { /* stan: loader znika (wolniejsze) */
    transition-duration: 1200ms, 1200ms; /* czas animacji: opacity, visibility */
    opacity: 0; /* zanikanie */
    visibility: hidden; /* ukrycie po animacji */
    pointer-events: none; /* brak przechwytywania kliknięć */
}

/* Możliwe wartości do testów i dostosowania:
   - position: static | relative | absolute | fixed | sticky
   - inset: auto | 0 | <length> | <percentage> (np. 0, 16px, 5%)
   - background: <color> (np. #fff, rgba(0,0,0,.8), var(--surface))
   - display: block | flex | grid | none
   - align-items: stretch | flex-start | center | flex-end | baseline
   - justify-content: flex-start | center | flex-end | space-between | space-around | space-evenly
   - z-index: auto | <integer> (np. 10, 999, 1050)
   - opacity: 0..1 (np. 0, 0.5, 1)
   - visibility: visible | hidden | collapse
   - pointer-events: auto | none | all
   - transition: <property> <duration> <timing-function> [<delay>]
   - transition-duration: <time> (np. 150ms, 700ms, 1.2s)
   - timing-function: linear | ease | ease-in | ease-out | ease-in-out | cubic-bezier(...)
*/

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.timeline-list {
    display: grid;
    gap: 8px;
}

.timeline-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    padding: 6px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

a.timeline-card {
    color: inherit;
}

a.timeline-card:hover {
    background: rgba(15, 23, 42, 0.02);
}

.timeline-card .meta {
    color: var(--muted);
    font-size: 12px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(15, 23, 42, 0.08);
    color: var(--ink);
}

.status-pending {
    color: #c2410c;
}

.status-processing {
    color: #1d4ed8;
}

.status-done {
    color: #047857;
}

.status-failed {
    color: #b91c1c;
}

.camera-box {
    display: grid;
    gap: 12px;
}

.camera-preview {
    border: 1px dashed rgba(15, 23, 42, 0.2);
    border-radius: 16px;
    padding: 8px;
    background: rgba(15, 23, 42, 0.02);
}

.media-preview {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.camera-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.validation-list {
    padding-left: 18px;
    color: #b91c1c;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.04);
}

.datetime-time-wrapper {
    margin-top: 6px;
}

.datetime-time-wrapper .form-label {
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: rgba(15, 23, 42, 0.65);
}

.datetime-time-input {
    max-width: 180px;
}

@media (max-width: 576px) {
    .panel {
        padding: 16px;
    }
}
