:root {
    --bg: #f4f6f8;
    --card: #fff;
    --ink: #1f2933;
    --muted: #7b8794;
    --brand: #2e7d32;
    --brand-dark: #1b5e20;
    --border: #e1e5ea;
    --danger: #c62828;
    --ok: #2e7d32;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.45;
}

.topbar {
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.topbar .brand { font-weight: 700; font-size: 1.1rem; }
.topbar nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar nav a { color: #fff; text-decoration: none; font-weight: 500; }
.topbar nav a:hover { text-decoration: underline; }
.topbar .who { opacity: .85; font-size: .85rem; }
.topbar .logout { background: rgba(255,255,255,.18); padding: .2rem .6rem; border-radius: 6px; }

.container { max-width: 1100px; margin: 1rem auto; padding: 0 1rem; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.login-card { max-width: 380px; margin: 3rem auto; }

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

label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .92rem; }
input[type=text], input[type=password], input[type=date], input[type=file],
select, textarea {
    width: 100%;
    padding: .65rem;
    margin-top: .3rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-weight: 400;
    background: #fff;
}
textarea { resize: vertical; }

fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 0 0 1rem;
    padding: .8rem;
}
legend { font-weight: 600; font-size: .85rem; padding: 0 .4rem; color: var(--muted); }

.btn {
    display: inline-block;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink);
    padding: .6rem 1rem;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn:hover { background: #f0f2f5; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

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

.alert { padding: .7rem .9rem; border-radius: 8px; margin-top: 1rem; }
.alert.error, .alert.error.alert { background: #fde8e8; color: var(--danger); }
.alert.success { background: #e6f4ea; color: var(--ok); }
.error { color: var(--danger); }

.report-form .ocr-box img { max-width: 100%; margin-top: .6rem; border-radius: 8px; }
.report-form button[type=submit] { width: 100%; margin-top: .5rem; }

.map { height: 280px; border-radius: 8px; margin: .6rem 0; border: 1px solid var(--border); z-index: 0; }

.photo-preview, .gallery { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.photo-preview img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; }
.gallery img { width: 160px; height: 160px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}
.filters label { margin: 0; }
.filters input, .filters select { width: auto; min-width: 140px; }
.filters .btn { height: fit-content; }

.actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.grid th, table.grid td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.grid th { background: #f7f9fb; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.grid td.notes { max-width: 220px; }

@media (max-width: 600px) {
    .filters { flex-direction: column; align-items: stretch; }
    .filters input, .filters select { width: 100%; }
}
