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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: #f0f0f0;
}

/* ── Map ── */
#map {
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: default;
}

#map.adding-mode {
    cursor: crosshair !important;
}

#map.adding-mode .leaflet-interactive {
    cursor: crosshair !important;
}

/* ── Panel wrapper (banner + sidebar) ── */
#panel {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 272px;
    z-index: 500;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

#reporyje-banner {
    display: block;
    width: 100%;
    height: 130px;
    object-fit: cover;
    object-position: 50% 50%;
}

/* ── Sidebar ── */
#sidebar {
    background: #fff;
    padding: 16px 20px 20px;
}

#sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

#sidebar-titles {
    flex: 1;
    min-width: 0;
}

#logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

#sidebar h2 {
    font-size: 17px;
    font-weight: 700;
    color: #1e2da0;
    line-height: 1.2;
}

#sidebar h3 {
    font-size: 13px;
    font-weight: 400;
    color: #1e2da0;
    opacity: .75;
    margin-top: 2px;
    margin-bottom: 0;
}

.instruction {
    font-size: 12.5px;
    color: #1e2da0;
    line-height: 1.55;
    margin-bottom: 16px;
}

/* ── Type buttons ── */
.type-buttons {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.type-btn {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 2px solid #e8e8e8;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color .18s, background .18s, transform .12s;
    width: 100%;
}

.type-btn:hover {
    background: #fafafa;
    transform: translateX(-2px);
}

.type-btn:active { transform: translateX(0); }

.type-btn.active.red-btn    { border-color: #35f600; background: #f4ffe8; }
.type-btn.active.yellow-btn { border-color: #feb00a; background: #fff8e6; }
.type-btn.active.green-btn  { border-color: #1e2da0; background: #eef0fa; }

.dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(0,0,0,.12);
}

.btn-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.btn-text strong {
    font-size: 12.5px;
    font-weight: 600;
    color: #1e2da0;
}

.btn-text small {
    font-size: 11px;
    color: #1e2da0;
    opacity: .7;
}

/* ── Hint ── */
.hint {
    margin-top: 14px;
    padding: 9px 12px;
    background: #eef6fd;
    border-radius: 7px;
    font-size: 12.5px;
    color: #1e2da0;
    font-weight: 600;
    text-align: center;
    animation: blink 1.8s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: .55; }
}


/* ── Hidden ── */
.hidden { display: none !important; }

/* ── Modal overlay ── */
#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .48);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

#modal {
    background: #fff;
    border-radius: 14px;
    width: 420px;
    max-width: 94vw;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .28);
    animation: modal-in .18s ease;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(.95) translateY(8px); }
    to   { opacity: 1; transform: none; }
}

#modal-color-bar {
    height: 5px;
    border-radius: 14px 14px 0 0;
    transition: background .2s;
}

#modal-body {
    padding: 24px 26px 26px;
}

#modal h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Form ── */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.required { color: #e74c3c; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1.5px solid #ddd;
    border-radius: 7px;
    font-size: 13.5px;
    font-family: inherit;
    color: #222;
    transition: border-color .18s;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* File input */
.form-group input[type="file"] {
    display: none;
}

.file-label {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border: 1.5px dashed #ccc;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    color: #777;
    transition: border-color .18s, color .18s;
    width: 100%;
    justify-content: center;
}

.file-label:hover {
    border-color: #3498db;
    color: #3498db;
}

.file-label.has-file {
    border-style: solid;
    border-color: #27ae60;
    color: #27ae60;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.btn-cancel {
    padding: 9px 18px;
    border: 1.5px solid #ddd;
    border-radius: 7px;
    background: #fff;
    color: #666;
    cursor: pointer;
    font-size: 13.5px;
    font-family: inherit;
    transition: background .15s;
}

.btn-cancel:hover { background: #f5f5f5; }

.btn-submit {
    padding: 9px 20px;
    border: none;
    border-radius: 7px;
    background: #1e2da0;
    color: #fff;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    transition: background .15s;
}

.btn-submit:hover    { background: #0e1550; }
.btn-submit:disabled { background: #aaa; cursor: not-allowed; }

/* ── Leaflet popup customization ── */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.18) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: auto !important;
}

.popup-inner {
    padding: 14px 16px;
    min-width: 180px;
    max-width: 260px;
}

.popup-type {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.popup-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.popup-desc {
    font-size: 12.5px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 8px;
}

.popup-img {
    width: 100%;
    border-top: 1px solid #f0f0f0;
    display: block;
}

.popup-status {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    margin-bottom: 5px;
}

.popup-pending-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.popup-btn-edit,
.popup-btn-delete {
    flex: 1;
    padding: 6px 0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}

.popup-btn-edit {
    border: 1.5px solid #1e2da0;
    background: #fff;
    color: #1e2da0;
}
.popup-btn-edit:hover { background: #eef0fa; }

.popup-btn-delete {
    border: none;
    background: #fee2e2;
    color: #dc2626;
}
.popup-btn-delete:hover { background: #fecaca; }

.popup-footer {
    font-size: 11px;
    color: #aaa;
    padding-top: 6px;
    border-top: 1px solid #f5f5f5;
    margin-top: 4px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    #panel {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
    }

    #reporyje-banner {
        display: none;
    }

    .type-buttons {
        flex-direction: row;
    }

    .type-btn {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 10px 6px;
        flex: 1;
    }

    .btn-text small {
        display: none;
    }
}
