/* Bark2Play administracija: boje brenda iz contracts/design/tokens.json */
:root {
    color-scheme: light dark;
    --brand: #ef4458;
    --primary: #d43f46;
    --primary-soft: #ffdad9;
    --success: #1a7f66;
    --success-soft: #d5f1e8;
    --warning: #b86a0c;
    --warning-soft: #fdebd3;
    --danger: #ba1a1a;
    --danger-soft: #ffdad6;
    --bg: #f6f4f5;
    --surface: #ffffff;
    --surface-2: #f4f1f2;
    --text: #1c1b1d;
    --muted: #6e6f72;
    --border: #e4e1e3;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .04);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #ffb3b0;
        --primary-soft: #5c1a1f;
        --success: #7bd8ba;
        --success-soft: #0f3b2f;
        --warning: #f2b35e;
        --warning-soft: #45300f;
        --danger: #ffb4ab;
        --danger-soft: #5c1612;
        --bg: #141213;
        --surface: #1c1a1b;
        --surface-2: #2a2728;
        --text: #e8e1e2;
        --muted: #a9aaad;
        --border: #3a3739;
        --shadow: none;
    }
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

h1 {
    font-size: 1.6rem;
    margin: 0 0 1rem;
}

    h1:focus {
        outline: none;
    }

h2 {
    font-size: 1.05rem;
    margin: 0 0 .75rem;
}

code {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: .85em;
    background: var(--surface-2);
    padding: .1em .35em;
    border-radius: 4px;
}

.muted {
    color: var(--muted);
}

.small-print {
    font-size: .8rem;
}

.quote {
    display: block;
    margin: .35rem 0;
    padding: .35rem .6rem;
    border-left: 3px solid var(--border);
    color: var(--text);
    white-space: pre-wrap;
}

/* Raspored */

.shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1rem .75rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    padding: .25rem .5rem 1rem;
}

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

    .brand:hover {
        text-decoration: none;
    }

.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .nav a {
        color: var(--text);
        padding: .55rem .75rem;
        border-radius: 8px;
    }

        .nav a:hover {
            background: var(--surface-2);
            text-decoration: none;
        }

        .nav a.active {
            background: var(--primary-soft);
            color: var(--primary);
            font-weight: 600;
        }

.main {
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.who {
    color: var(--muted);
    font-size: .9rem;
}

.content {
    padding: 1.5rem;
    max-width: 1280px;
}

.centered {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 800px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .content {
        padding: 1rem;
    }
}

/* Kartice i statistika */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

.card.login {
    width: min(420px, 100%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 2rem;
}

    .card.login form {
        width: 100%;
    }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .75rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    color: var(--text);
    box-shadow: var(--shadow);
}

    .stat:hover {
        text-decoration: none;
        border-color: var(--primary);
    }

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-label {
    font-weight: 600;
}

.stat-hint {
    color: var(--muted);
    font-size: .8rem;
}

.stat.success .stat-value {
    color: var(--success);
}

.stat.danger .stat-value {
    color: var(--danger);
}

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .5rem;
    margin: 1rem 0;
}

    .facts > div {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: .6rem .8rem;
        display: flex;
        flex-direction: column;
        gap: .15rem;
    }

    .facts span {
        color: var(--muted);
        font-size: .8rem;
    }

    .facts strong {
        overflow-wrap: anywhere;
    }

    .facts .ok {
        color: var(--success);
    }

    .facts .bad {
        color: var(--danger);
    }

/* Profil */

.breadcrumb {
    margin: 0 0 .5rem;
    font-size: .9rem;
}

.profile {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: start;
}

    .profile h1 {
        margin-bottom: .25rem;
    }

    .profile p {
        margin: .2rem 0;
    }

@media (max-width: 800px) {
    .profile {
        grid-template-columns: auto 1fr;
    }

        .profile .actions {
            grid-column: 1 / -1;
        }
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}

    .avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.person {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: var(--text);
}

    .person > span {
        display: flex;
        flex-direction: column;
    }

    .person:hover strong {
        color: var(--primary);
    }

.tiles {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    width: 130px;
    padding: .75rem .5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    text-align: center;
}

    .tile:hover {
        text-decoration: none;
        border-color: var(--primary);
    }

.list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .list li {
        padding: .5rem 0;
        border-bottom: 1px solid var(--border);
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .4rem;
    }

        .list li:last-child {
            border-bottom: none;
        }

        .list li > a:not(.person) {
            display: flex;
            flex-direction: column;
            color: var(--text);
        }

/* Tabele */

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

    .table th, .table td {
        padding: .55rem .75rem;
        text-align: left;
        vertical-align: top;
        border-bottom: 1px solid var(--border);
    }

    .table th {
        font-size: .8rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--muted);
        background: var(--surface-2);
    }

    .table tbody tr:last-child td {
        border-bottom: none;
    }

    .table tbody tr:hover {
        background: var(--surface-2);
    }

    .table .num {
        text-align: right;
        white-space: nowrap;
    }

    .table td .small-print {
        display: block;
    }

.card .table {
    border: none;
    box-shadow: none;
}

@media (max-width: 800px) {
    .table {
        display: block;
        overflow-x: auto;
    }
}

/* Dugmad, oznake, polja */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 10px;
    padding: .5rem .9rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

    .button:hover {
        border-color: var(--primary);
        text-decoration: none;
    }

    .button:disabled {
        opacity: .5;
        cursor: default;
    }

    .button.primary {
        background: #d43f46;
        border-color: #d43f46;
        color: #fff;
    }

    .button.danger {
        background: #ba1a1a;
        border-color: #ba1a1a;
        color: #fff;
    }

    .button.ghost {
        background: transparent;
    }

    .button.small {
        padding: .3rem .6rem;
        font-size: .85rem;
    }

    .button.block {
        width: 100%;
    }

.danger-text {
    color: var(--danger) !important;
}

.actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    align-items: center;
}

    .actions.wrap {
        flex-wrap: wrap;
    }

form.inline {
    display: inline;
    margin: 0;
}

.badge {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--muted);
    margin-right: .25rem;
}

    .badge.success {
        background: var(--success-soft);
        color: var(--success);
    }

    .badge.warning {
        background: var(--warning-soft);
        color: var(--warning);
    }

    .badge.danger {
        background: var(--danger-soft);
        color: var(--danger);
    }

.callout {
    border-radius: 10px;
    padding: .6rem .8rem;
    margin: .5rem 0;
}

    .callout.error {
        background: var(--danger-soft);
        color: var(--danger);
    }

    .callout.warning {
        background: var(--warning-soft);
        color: var(--warning);
    }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.search {
    display: flex;
    gap: .5rem;
    flex: 1 1 320px;
    max-width: 520px;
}

input[type=search], input[type=email], textarea {
    flex: 1;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .5rem .75rem;
}

    input[type=search]:focus, input[type=email]:focus, textarea:focus {
        outline: 2px solid var(--primary);
        outline-offset: -1px;
    }

.field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin: .75rem 0;
    text-align: left;
}

    .field span {
        font-weight: 600;
        font-size: .9rem;
    }

.tabs {
    display: inline-flex;
    background: var(--surface-2);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

    .tabs button {
        border: none;
        background: transparent;
        color: var(--muted);
        font: inherit;
        font-weight: 600;
        padding: .4rem .8rem;
        border-radius: 8px;
        cursor: pointer;
    }

        .tabs button.active {
            background: var(--surface);
            color: var(--text);
            box-shadow: var(--shadow);
        }

.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.loading, .empty {
    padding: 2rem 0;
    text-align: center;
}

/* Fotografije */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .75rem;
}

.photo {
    margin: 0;
}

    .photo img {
        width: 100%;
        aspect-ratio: 1;
        object-fit: cover;
        border-radius: 10px;
        background: var(--surface-2);
        display: block;
    }

    .photo figcaption {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: .25rem;
    }

.moment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.moment {
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

    .moment img {
        width: 100%;
        aspect-ratio: 1;
        object-fit: cover;
        display: block;
        background: var(--surface-2);
    }

    .moment figcaption {
        padding: .6rem .75rem .75rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: .25rem;
    }

.report-list {
    display: flex;
    flex-direction: column;
}

.report header {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.report-context img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
}

/* Sličica u tabeli (izgubljeni i nađeni psi) */
img.thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Dijalog i poruke */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: grid;
    place-items: center;
    padding: 1rem;
    z-index: 900;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    width: min(480px, 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}

    .modal .actions {
        margin-top: 1rem;
    }

.toasts {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    z-index: 950;
    max-width: min(420px, calc(100% - 2rem));
}

.toast {
    padding: .7rem 1rem;
    border-radius: 10px;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
    cursor: pointer;
}

    .toast.success {
        background: #1a7f66;
    }

    .toast.error {
        background: #ba1a1a;
    }

/* Blazor */

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Došlo je do greške."
    }
