  :root {
    --bg: #f4f6fa; --card: #fff; --text: #1d2433; --muted: #6b7386; --line: #e3e7ef;
    --primary: #1f6feb; --primary-d: #1757c2; --danger: #d93f3f; --ok: #1f9d55; --warn: #d98a00;
    --radius: 12px; --shadow: 0 1px 3px rgba(20,30,60,.08), 0 4px 14px rgba(20,30,60,.05);
  }
  * { box-sizing: border-box; }
  body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
  header { background: #142036; color: #fff; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 58px; position: sticky; top: 0; z-index: 20; }
  header h1 { font-size: 18px; margin: 0; white-space: nowrap; }
  nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; min-width: 0; }
  nav button { background: none; border: 0; color: #b9c4da; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; white-space: nowrap; }
  nav button.active, nav button:hover { background: rgba(255,255,255,.1); color: #fff; }
  main { max-width: 1280px; margin: 0 auto; padding: 24px; }
  .toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
  .toolbar .grow { flex: 1; min-width: 200px; }
  input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); width: 100%; }
  input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31,111,235,.25); border-color: var(--primary); }
  .toolbar select { width: auto; }
  textarea { min-height: 80px; resize: vertical; }
  .btn { font: inherit; border: 1px solid var(--line); background: #fff; padding: 9px 15px; border-radius: 8px; cursor: pointer; white-space: nowrap; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
  .btn:hover { background: #f0f3f8; }
  .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
  .btn.primary:hover { background: var(--primary-d); }
  .btn.danger { color: var(--danger); border-color: #f1c4c4; }
  .btn.danger:hover { background: #fdf0f0; }
  .btn.sm { padding: 5px 10px; font-size: 13px; }
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
  .card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
  .listing { cursor: pointer; transition: transform .12s; }
  .listing:hover { transform: translateY(-2px); }
  .listing .cover { height: 180px; background: #dde3ee center/cover no-repeat; position: relative; display: flex; align-items: center; justify-content: center; color: #95a0b5; font-size: 40px; }
  .listing .cover .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
  .listing .cover .count { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 20px; }
  .listing .body { padding: 14px 16px 16px; }
  .listing .price { font-size: 19px; font-weight: 700; color: var(--primary); }
  .listing .title { font-weight: 600; margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .listing .loc, .muted { color: var(--muted); font-size: 13px; }
  .listing .specs { display: flex; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
  .badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; background: #e8eefb; color: var(--primary); }
  .badge.s-Aktif, .badge.s-Sıcak { background: #e3f5eb; color: var(--ok); }
  .badge.s-Opsiyonlu, .badge.s-Görüşülüyor { background: #fff3dc; color: var(--warn); }
  .badge.s-Satıldı, .badge.s-Kiralandı, .badge.s-Tamamlandı { background: #ece4fb; color: #6b3fd1; }
  .badge.s-Pasif, .badge.s-Soğuk { background: #eceef2; color: var(--muted); }
  .badge.dark { background: rgba(20,32,54,.85); color: #fff; }
  .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
  .stat { padding: 18px; }
  .stat .v { font-size: 26px; font-weight: 700; margin-top: 4px; }
  h2 { font-size: 17px; margin: 0 0 14px; }
  table { width: 100%; border-collapse: collapse; }
  th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  th { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 600; background: #fafbfd; }
  tr.click { cursor: pointer; }
  tr.click:hover td { background: #f7f9fc; }
  .empty { text-align: center; padding: 60px 20px; color: var(--muted); }
  .empty .ico { font-size: 44px; margin-bottom: 8px; }

  .modal-bg { position: fixed; inset: 0; background: rgba(15,22,38,.55); display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto; z-index: 50; }
  .modal { background: #fff; border-radius: 14px; width: 100%; max-width: 900px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
  .modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); gap: 10px; }
  .modal-h h3 { margin: 0; font-size: 17px; }
  .modal-b { padding: 20px 22px; }
  .modal-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
  .x { background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
  fieldset { border: 0; padding: 0; margin: 0 0 20px; }
  legend { font-weight: 700; font-size: 13px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; letter-spacing: .03em; }
  .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
  .fields .full { grid-column: 1 / -1; }
  label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
  label.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 9px 0; }
  label.chk input { width: auto; }
  .req::after { content: " *"; color: var(--danger); }

  .drop { border: 2px dashed #c4cddd; border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; }
  .drop.over { border-color: var(--primary); background: #eef4ff; color: var(--primary); }
  .thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
  .thumb { position: relative; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: #eee center/cover; border: 2px solid transparent; }
  .thumb.cover-sel { border-color: var(--primary); }
  .thumb .acts { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
  .thumb .acts button { background: rgba(255,255,255,.9); border: 0; border-radius: 5px; font-size: 12px; padding: 2px 6px; cursor: pointer; }
  .thumb .tag { position: absolute; top: 5px; left: 5px; background: var(--primary); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; }

  .gallery-main { height: 420px; background: #111 center/contain no-repeat; border-radius: 10px; cursor: zoom-in; position: relative; }
  .gallery-strip { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
  .gallery-strip div { flex: 0 0 90px; height: 66px; border-radius: 6px; background: #ddd center/cover; cursor: pointer; opacity: .6; border: 2px solid transparent; }
  .gallery-strip div.on { opacity: 1; border-color: var(--primary); }
  .detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 18px; }
  .detail-grid div { background: #fff; padding: 10px 14px; box-shadow: 0 0 0 .5px var(--line); }
  .detail-grid span { display: block; font-size: 12px; color: var(--muted); }
  .detail-grid b { font-weight: 600; }
  .notes { white-space: pre-wrap; background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 14px; }

  .lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 80; display: flex; align-items: center; justify-content: center; }
  .lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
  .lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); color: #fff; border: 0; font-size: 34px; width: 56px; height: 76px; cursor: pointer; border-radius: 8px; }
  .lightbox .prev { left: 16px; } .lightbox .next { right: 16px; }
  .lightbox .top { position: absolute; top: 14px; right: 16px; display: flex; gap: 10px; align-items: center; color: #fff; }
  .lightbox .top button, .lightbox .top a { background: rgba(255,255,255,.15); color: #fff; border: 0; padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; text-decoration: none; }

  #toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #142036; color: #fff; padding: 11px 20px; border-radius: 10px; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
  #toast.show { opacity: 1; }
  #toast.err { background: var(--danger); }
  .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .between { justify-content: space-between; }
  .linklist { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
  .linkitem { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
  .linkitem:hover { background: #f7f9fc; }
  .linkitem .im { width: 64px; height: 48px; border-radius: 6px; background: #dde3ee center/cover; flex: 0 0 auto; }
  .pick { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
  @media (max-width: 640px) { main { padding: 14px; } header { gap: 12px; padding: 0 12px; } .gallery-main { height: 260px; } }
  /* Giriş ekranı */
  .auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #142036, #1f3a68); }
  .auth-box { background: #fff; border-radius: 16px; padding: 32px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
  .auth-box h1 { margin: 0 0 6px; font-size: 22px; }
  .auth-box form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
  .auth-box .err { color: var(--danger); font-size: 13px; min-height: 18px; }
  .progress { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 10px; display: none; }
  .progress.on { display: block; }
  .progress div { height: 100%; background: var(--primary); width: 0; transition: width .2s; }
  code.addr { background: #eef2f8; padding: 4px 8px; border-radius: 6px; font-size: 14px; user-select: all; }
  /* Eşitleme durumu */
  .sync { margin-left: auto; font: inherit; font-size: 13px; border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap; color: #fff; background: rgba(255,255,255,.12); }
  .sync.ok { background: rgba(31,157,85,.85); }
  .sync.busy { background: rgba(31,111,235,.85); }
  .sync.warn { background: rgba(217,138,0,.9); }
  .sync.err { background: var(--danger); }
  .sync:empty { display: none; }
  table.diff { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
  table.diff th, table.diff td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-word; }
  table.diff th { color: var(--muted); font-weight: 600; }
  @media (max-width: 640px) { .sync { font-size: 12px; padding: 5px 9px; } header h1 { display: none; } }
