:root {
  --bg: #f4f4f5; --surface: #fff; --border: #e4e4e7; --text: #18181b;
  --muted: #71717a; --hint: #a1a1aa; --label: #3f3f46; --nav-link: #52525b;
  --input-bg: #fff; --input-border: #d4d4d8; --check-bg: #f4f4f5;
  --shadow-sm: rgba(0,0,0,.07); --shadow-md: rgba(0,0,0,.10); --shadow-auth: rgba(0,0,0,.08);
}
[data-theme=dark] {
  --bg: #09090b; --surface: #18181b; --border: #27272a; --text: #fafafa;
  --muted: #a1a1aa; --hint: #52525b; --label: #d4d4d8; --nav-link: #a1a1aa;
  --input-bg: #27272a; --input-border: #3f3f46; --check-bg: #27272a;
  --shadow-sm: rgba(0,0,0,.25); --shadow-md: rgba(0,0,0,.35); --shadow-auth: rgba(0,0,0,.30);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
       background: var(--bg); color: var(--text); line-height: 1.5; }
a { text-decoration: none; color: inherit; }

nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.nav-inner { max-width: 1120px; margin: 0 auto; padding: 0 20px;
             display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.logo span { color: #2563eb; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a { font-size: 14px; color: var(--nav-link); padding: 6px 12px; border-radius: 6px; }
.nav-links a:hover { background: var(--bg); color: var(--text); }
.nav-links .btn-nav { background: #2563eb; color: #fff !important; }
.nav-links .btn-nav:hover { background: #1d4ed8; }
.theme-btn { background: none; border: 1px solid var(--border); border-radius: 6px;
             padding: 5px 9px; cursor: pointer; font-size: 14px; color: var(--text);
             transition: background .15s; margin-left: 2px; }
.theme-btn:hover { background: var(--bg); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.page-head { padding: 28px 0 16px; }
.page-head h1 { font-size: 22px; font-weight: 700; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
             background: var(--bg); padding: 20px; }
.auth-card { background: var(--surface); border-radius: 12px; padding: 36px; width: 100%; max-width: 400px;
             box-shadow: 0 2px 12px var(--shadow-auth); }
.auth-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--label); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--input-border); border-radius: 7px;
               background: var(--input-bg); color: var(--text);
               font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; font-family: inherit; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.field .hint { font-size: 12px; color: var(--hint); margin-top: 4px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.checks label { display: flex; align-items: center; gap: 6px; padding: 6px 12px;
                background: var(--check-bg); border: 1px solid var(--border); border-radius: 6px;
                font-size: 13px; cursor: pointer; user-select: none; }
.checks label.active { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.checks input[type=checkbox] { width: 14px; height: 14px; accent-color: #2563eb; }

.btn { display: inline-flex; align-items: center; justify-content: center;
       padding: 10px 18px; border-radius: 7px; font-size: 14px; font-weight: 500;
       cursor: pointer; border: none; transition: all .15s; }
.btn-primary { background: #2563eb; color: #fff; width: 100%; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { background: var(--surface); color: var(--label); border: 1px solid var(--input-border); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 5px; width: auto; }
.btn-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }

.err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
       border-radius: 7px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; display: none; }
.ok  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
       border-radius: 7px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; display: none; }
.auth-foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }
.auth-foot a { color: #2563eb; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 18px; padding-bottom: 40px; }
.card { background: var(--surface); border-radius: 10px; overflow: hidden;
        box-shadow: 0 1px 4px var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 6px 20px var(--shadow-md); transform: translateY(-2px); }
.card-photo { width: 100%; height: 176px; object-fit: cover; display: block; }
.card-no-photo { width: 100%; height: 176px; background: linear-gradient(135deg,var(--check-bg),var(--border));
                 display: flex; align-items: center; justify-content: center;
                 color: var(--hint); font-size: 36px; }
.card-body { padding: 14px 16px 16px; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.card-adres { font-size: 14px; font-weight: 600; line-height: 1.35; flex: 1; min-width: 0;
              overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
         margin-left: 8px; white-space: nowrap; flex-shrink: 0; }
.badge-pararius { background: #fff3e0; color: #c2410c; }
.badge-kamernet  { background: #ecfdf5; color: #065f46; }
.badge-funda     { background: #eff6ff; color: #1d4ed8; }
.card-prijs { font-size: 19px; font-weight: 700; color: #2563eb; margin-bottom: 6px; }
.card-meta { font-size: 12px; color: var(--muted); }
.card-link { display: inline-block; margin-top: 10px; font-size: 13px; color: #2563eb; }
.card-link:hover { text-decoration: underline; }

.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-label { font-size: 13px; color: var(--muted); }
.filter-pill { font-size: 12px; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border);
               background: var(--surface); color: var(--label); }
.filter-pill:hover { background: var(--bg); }
.filter-pill.active { background: #2563eb; color: #fff; border-color: #2563eb; }

.card-meta-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.age-badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.age-new    { background: #f0fdf4; color: #166534; }
.age-recent { background: #fff7ed; color: #c2410c; }
.age-old    { background: #fef2f2; color: #b91c1c; }
.age-line { font-size: 12px; margin-top: 4px; }
.age-line.age-new    { color: #166534; }
.age-line.age-recent { color: #c2410c; }
.age-line.age-old    { color: #b91c1c; }

.scraper-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-bottom: 40px; }
.scraper-row { background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
               padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; }
.scraper-name { font-weight: 600; font-size: 15px; }
.scraper-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; width: 40px; height: 22px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 22px; transition: .2s; }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
                         background: #fff; border-radius: 50%; transition: .2s; }
.toggle input:checked + .toggle-slider { background: #22c55e; }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

.pager { display: flex; gap: 6px; justify-content: center; padding: 16px 0 40px; flex-wrap: wrap; }
.pager a, .pager span { padding: 7px 13px; border-radius: 6px; font-size: 14px;
                         border: 1px solid var(--border); background: var(--surface); color: var(--label); }
.pager a:hover { background: var(--bg); }
.pager .cur { background: #2563eb; color: #fff; border-color: #2563eb; }

.empty { text-align: center; padding: 64px 20px; grid-column: 1/-1; }
.empty .icon { font-size: 44px; margin-bottom: 14px; }
.empty h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty p { color: var(--muted); font-size: 14px; }
.empty a { color: #2563eb; }

.form-page { max-width: 580px; margin: 36px auto 60px; padding: 0 20px; }
.form-page h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.form-page .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.form-card { background: var(--surface); border-radius: 12px; padding: 28px;
             box-shadow: 0 1px 6px var(--shadow-sm); }
.section-label { font-size: 12px; font-weight: 600; color: var(--hint); text-transform: uppercase;
                 letter-spacing: .6px; margin: 22px 0 10px; }
.section-label:first-child { margin-top: 0; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; }

.mb-output { margin-top: 24px; }
.mb-output-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mb-textarea { width: 100%; padding: 14px; border: 1px solid var(--input-border); border-radius: 7px;
               background: var(--input-bg); color: var(--text); font-size: 14px;
               font-family: inherit; line-height: 1.6; resize: vertical; outline: none;
               transition: border-color .15s, box-shadow .15s; }
.mb-textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

.admin-table-wrap { overflow-x: auto; padding-bottom: 40px; margin-top: 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--hint);
                  text-transform: uppercase; letter-spacing: .5px; padding: 10px 12px;
                  border-bottom: 2px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--check-bg); }
.admin-actions { display: flex; gap: 6px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100;
                 display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 12px; padding: 28px; width: 100%; max-width: 500px;
         box-shadow: 0 8px 32px rgba(0,0,0,.25); max-height: 90vh; overflow-y: auto; }
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px;
             background: none; border: 1px solid var(--border); border-radius: 6px;
             padding: 8px 10px; cursor: pointer; width: 38px; height: 38px; }
.hamburger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 1px; }

@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 20px; }
  .form-actions { flex-direction: column; }

  .hamburger { display: flex; }
  .nav-links { display: none; flex-direction: column; position: fixed; top: 56px; left: 0; right: 0;
               background: var(--surface); border-bottom: 1px solid var(--border);
               padding: 8px 16px 12px; gap: 2px; z-index: 200; }
  .nav-links.open { display: flex; }
  .nav-links a, .nav-links button { width: 100%; text-align: left; padding: 10px 12px; }
  .nav-links .btn-nav { margin-top: 4px; justify-content: center; }
}
