@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }


:root {
    --bg: #f4f9f4;
    --surface: #ffffff;
    --surface2: #f0f7f0;
    --border: rgba(0,0,0,0.08);
    --border-hover: rgba(0,0,0,0.16);
    --text-primary: #1a2e1a;
    --text-muted: #7a8f7a;
    --accent: #3dc45a;
    --accent-dark: #2aa347;
    --accent-dim: rgba(61,196,90,0.12);
    --accent-light: #e8f8eb;
    --error-bg: rgba(220,80,60,0.08);
    --error-border: rgba(220,80,60,0.25);
    --error-text: #d94f3a;
    --nav-h: 60px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
}


html, body {
    height: 100%;
    background: var(--bg);
    font-family: 'Nunito', sans-serif;
    color: var(--text-primary);
}


nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: var(--nav-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 2rem;
    box-shadow: var(--shadow);
}

.nav-brand {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.nav-brand span { color: var(--text-primary); }

.nav-links { display: flex; gap: 0.25rem; }

.nav-links a {
    padding: 0.45rem 1rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-pill);
    transition: color 0.15s, background 0.15s;
}

.nav-links a:hover { color: var(--text-primary); background: var(--surface2); }
.nav-links a.active { color: var(--accent-dark); background: var(--accent-dim); }

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-dark);
}

.nav-signout {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.35rem 0.85rem;
    transition: border-color 0.15s, color 0.15s;
}

.nav-signout:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
}


.btn-primary {
    background: var(--accent);
    border: none;
    border-radius: var(--radius-pill);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(61,196,90,0.3);
}

.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: 0 4px 16px rgba(61,196,90,0.4);
}
.btn-primary:active {
    transform: scale(0.98);
}

.btn-ghost {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
}


.field { margin-bottom: 1.25rem; }

.field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
select {
    width: 100%;
    background: var(--accent-light);
    border: 1.5px solid transparent;
    border-radius: var(--radius-pill);
    padding: 0.75rem 1.1rem;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

input[type="date"] { border-radius: var(--radius-sm); }
select {
    border-radius: var(--radius-sm);
}

input:focus, select:focus {
    border-color: var(--accent);
    background: #ffffff;
}

input::placeholder { color: var(--text-muted); }
select option { background: #ffffff; }

.checkbox-list { display: flex; flex-direction: column; gap: 0.45rem; }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    accent-color: var(--accent);
    width: 15px; height: 15px;
    cursor: pointer;
}


.error-box {
    background: var(--error-bg);
    border: 1.5px solid var(--error-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--error-text);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-box::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--error-text);
    font-size: 11px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

/* filter panel */
.filter-panel {
    position: absolute;
    top: 1rem; right: 1rem;
    z-index: 500;
    width: 250px;
    max-height: calc(100vh - var(--nav-h) - 2rem);
    background: var(--surface);
    overflow: scroll;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.filter-header {
    position: sticky;
    top: 0;
    padding: 0.9rem 1rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--accent-light);
}

.filter-header-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-dark);
    letter-spacing: 0.02em;
}

.filter-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    line-height: 1;
    font-size: 18px;
    transition: color 0.15s;
}

.filter-toggle:hover { color: var(--accent-dark); }

.filter-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    overflow-y: auto;
    flex: 1;
}

.filter-body.collapsed { display: none; }

.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filter-actions {
    padding: 0 1rem 1rem;
    display: flex;
    gap: 0.5rem;
    background: var(--surface);
    flex-shrink: 0;
}

.filter-actions .btn-primary { flex: 1; padding: 0.6rem; }
.filter-actions .btn-ghost { padding: 0.6rem 0.85rem; }


/* map legend */
.map-legend {
    position: absolute;
    bottom: 1.5rem; left: 1rem;
    z-index: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 12px;
    box-shadow: var(--shadow);
}

.legend-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-dark);
    margin-bottom: 0.5rem;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}


.leaflet-tile {
    filter: saturate(0.9) brightness(1.02);
}
.leaflet-container { background: #e8f0e8; }

.leaflet-popup-content-wrapper {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-md) !important;
    padding: 0 !important;
    width: 300px !important;
    overflow: hidden;
}

.leaflet-popup-tip-container { display: none; }
.leaflet-popup-content {
    margin: 0 !important;
    width: 100% !important;
}

/* report popup */
.popup-image {
    width: 100%; height: 160px;
    object-fit: cover;
    display: block;
    background: var(--surface2);
}

.popup-image-placeholder {
    width: 100%; height: 120px;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.popup-body { padding: 1rem 1.1rem; }

.popup-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-dark);
    background: var(--accent-dim);
    border-radius: var(--radius-pill);
    padding: 0.2rem 0.65rem;
    margin-bottom: 0.5rem;
}

.popup-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.popup-description {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.9rem;
}

.popup-footer {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.popup-reactions { display: flex; gap: 1rem; }

.reaction {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.reaction-icon                    { font-size: 15px; }
.reaction.likes    .reaction-icon { color: #3dc45a; }
.reaction.dislikes .reaction-icon { color: #e05555; }

.popup-meta {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface2);
    border-radius: var(--radius-pill);
    padding: 0.2rem 0.6rem;
}

/* image list */
.carousel {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: var(--surface2);
}

.carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.carousel-slide.active { opacity: 1; }

.leaflet-popup-content .carousel-slide {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.85);
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: background 0.15s;
}

.carousel-arrow:hover { background: #ffffff; }
.carousel-arrow.left  { left: 6px; }
.carousel-arrow.right { right: 6px; }

.carousel-dots {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.carousel-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.15s;
}

.carousel-dot.active { background: var(--accent); }

/* admin page shared */
main {
    margin-top: calc(var(--nav-h) + 2rem);
    padding: 0 2rem 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title    { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.page-subtitle { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-top: 0.15rem; }

.page-count {
    font-size: 13px; font-weight: 700; color: var(--text-muted);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-pill); padding: 0.35rem 0.9rem;
}


.table-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}

.table-toolbar {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
    background: var(--accent-light); flex-wrap: wrap;
}

.search-input {
    flex: 1; min-width: 160px;
    background: var(--surface) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.55rem 0.9rem !important;
    font-size: 13px !important;
}

.filter-select {
    width: 140px;
    background: var(--surface) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.55rem 0.9rem !important;
    font-size: 13px !important;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--surface2); }

th {
    padding: 0.75rem 1rem; text-align: left;
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); white-space: nowrap;
}

td {
    padding: 0.75rem 1rem; border-top: 1px solid var(--border);
    font-weight: 500; color: var(--text-primary); vertical-align: middle;
}

tr:hover td { background: var(--accent-light); }

.state-row td {
    text-align: center; padding: 3rem;
    color: var(--text-muted); font-weight: 600; font-size: 14px;
}

/* badges */
.badge {
    display: inline-block; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    border-radius: var(--radius-pill); padding: 0.2rem 0.65rem;
}

.status-PENDING  { background: rgba(245,166,35,0.12); color: #c8820a; }
.status-RESOLVED { background: var(--accent-dim); color: var(--accent-dark); }
.status-CLOSED   { background: rgba(220,80,60,0.1); color: var(--error-text); }

.review-VALID    { background: var(--accent-dim); color: var(--accent-dark); }
.review-INVALID  { background: rgba(220,80,60,0.1); color: var(--error-text); }
.review-UNKNOWN  { background: rgba(0,0,0,0.06); color: var(--text-muted); }

.valid-true  { background: var(--accent-dim); color: var(--accent-dark); }
.valid-false { background: rgba(220,80,60,0.1); color: var(--error-text); }

.type-ADD_REPORT    { background: var(--accent-dim); color: var(--accent-dark); }
.type-REVIEW_REPORT { background: rgba(91,130,212,0.12); color: #3a5fc8; }

.mission-active   { background: var(--accent-dim); color: var(--accent-dark); }
.mission-upcoming { background: rgba(91,130,212,0.12); color: #3a5fc8; }
.mission-expired  { background: rgba(220,80,60,0.1); color: var(--error-text); }

/* pagination */
.pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.85rem 1.25rem; border-top: 1px solid var(--border);
    background: var(--surface2);
}

.pagination-info { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 0.4rem; }

.page-btn {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: var(--surface);
    font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}

.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-dark); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* users page */
.user-cell  { display: flex; align-items: center; gap: 0.75rem; }

.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--accent-dim); border: 2px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; color: var(--accent-dark); flex-shrink: 0;
}

.user-name  { font-weight: 700; color: var(--text-primary); }
.user-email { font-size: 12px; font-weight: 500; color: var(--text-muted); }

.role-badge {
    display: inline-block; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    border-radius: var(--radius-pill); padding: 0.2rem 0.65rem;
}

.role-ADMIN     { background: rgba(229,115,50,0.12); color: #c8621a; }
.role-NORMAL    { background: var(--accent-dim); color: var(--accent-dark); }
.role-AUTHORITY { background: rgba(91,130,212,0.12); color: #3a5fc8; }

.verified-yes { background: var(--accent-dim); color: var(--accent-dark); font-size: 11px; font-weight: 700; border-radius: var(--radius-pill); padding: 0.2rem 0.65rem; }
.verified-no  { background: rgba(220,80,60,0.1); color: var(--error-text); font-size: 11px; font-weight: 700; border-radius: var(--radius-pill); padding: 0.2rem 0.65rem; }

.btn-delete {
    background: none; border: 1.5px solid rgba(220,80,60,0.3);
    border-radius: var(--radius-pill); color: var(--error-text);
    font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 700;
    padding: 0.35rem 0.85rem; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-delete:hover { background: rgba(220,80,60,0.08); border-color: var(--error-text); }

/* delete modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.35);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-md); padding: 2rem; width: 100%;
    max-width: 380px; margin: 1rem;
    transform: translateY(8px); transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-icon {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(220,80,60,0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: 1rem;
}

.modal h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.4rem; }

.modal p {
    font-size: 13px; font-weight: 500; color: var(--text-muted);
    margin-bottom: 1.5rem; line-height: 1.5;
}

.modal-actions { display: flex; gap: 0.75rem; }

.btn-confirm-delete {
    flex: 1; padding: 0.75rem; background: var(--error-text);
    border: none; border-radius: var(--radius-pill);
    font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
    color: white; cursor: pointer; transition: opacity 0.15s;
}

.btn-confirm-delete:hover { opacity: 0.88; }
.btn-cancel { flex: 1; padding: 0.75rem; }

/* reports page */
.report-cell  { display: flex; align-items: center; gap: 0.75rem; }
.report-title { font-weight: 700; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-desc  { font-size: 12px; color: var(--text-muted); max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.preview-img {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    object-fit: cover; background: var(--surface2); flex-shrink: 0;
}

.preview-img-placeholder {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    background: var(--surface2); display: flex; align-items: center;
    justify-content: center; color: var(--text-muted); font-size: 18px; flex-shrink: 0;
}

.reactions      { display: flex; gap: 0.75rem; font-size: 12px; font-weight: 700; }
.reaction-up    { color: #3dc45a; }
.reaction-down  { color: #e05555; }


.btn-close-report {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-close-report:hover {
    background: rgba(0,0,0,0.04);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* missions page */
.mission-title { font-weight: 700; }
.mission-desc  { font-size: 12px; color: var(--text-muted); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* reviews page */
.report-title-sm { font-weight: 700; }
.report-type-sm  { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

