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

:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --primary: #2d6a4f;
  --primary-dark: #1b4332;
  --danger: #c0392b;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 10px;
}

body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

.nav { background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; position: sticky; top: 0; z-index: 10; }
.nav-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.nav-links { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; }
.nav-user { color: rgba(255,255,255,0.6); font-size: 12px; }

.main { max-width: 640px; margin: 0 auto; padding: 16px; }

.flash { background: #fef3c7; border: 1px solid #f59e0b; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }

.btn-primary { background: var(--primary); color: #fff; border: none; border-radius: var(--radius); padding: 10px 18px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-primary-sm { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 5px 10px; font-size: 13px; cursor: pointer; text-decoration: none; }
.btn-danger-sm { background: transparent; color: var(--danger); border: 1px solid var(--danger); border-radius: 6px; padding: 3px 8px; font-size: 13px; cursor: pointer; }
.btn-move { background: transparent; color: var(--primary); border: 1px solid var(--primary); border-radius: 6px; padding: 4px 10px; font-size: 13px; cursor: pointer; }

.form-card { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 500; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 16px; background: var(--bg); color: var(--text); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--primary); border-color: transparent; }

.login-wrap { max-width: 360px; margin: 60px auto; text-align: center; }
.login-wrap h1 { font-size: 28px; margin-bottom: 24px; color: var(--primary); }

.dashboard-header { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.search-box { flex: 1; }
.location-group { margin-bottom: 20px; }
.location-label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 0; }
.empty-state a { color: var(--primary); }

.item-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.item-row { background: var(--card); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.item-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.item-thumb-placeholder { width: 40px; height: 40px; background: var(--bg); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.item-name { flex: 1; font-size: 15px; color: var(--text); text-decoration: none; }
.item-name:hover { color: var(--primary); }
.item-meta { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-header h2 { font-size: 20px; }
.back-link { color: var(--primary); text-decoration: none; font-size: 14px; }

.entity-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius); margin-bottom: 14px; }
.photo-placeholder { width: 100%; height: 140px; background: var(--card); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 48px; margin-bottom: 14px; }
.entity-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.entity-desc { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.location-badge { font-size: 14px; color: var(--primary); margin-bottom: 16px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.action-row { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: flex-end; z-index: 100; }
.modal.hidden { display: none; }
.modal-content { background: var(--card); border-radius: var(--radius) var(--radius) 0 0; padding: 24px; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.modal-content h3 { font-size: 18px; }

#search-results.hidden { display: none; }
#search-results li { cursor: pointer; }
