/* HBA Emlak — site ve fpanel ortak tasarım dili */
:root {
  --bg: #f6f4ef;
  --bg-2: #efebe2;
  --surface: #ffffff;
  --ink: #0f1c2b;
  --ink-2: #384757;
  --muted: #6b7684;
  --line: #e6e1d6;
  --line-2: #d9d3c6;
  --brand: #0b2540;
  --brand-2: #173f68;
  --brand-3: #245a8f;
  --brand-soft: #e9eef4;
  --gold: #c48a17;
  --gold-2: #e2ae47;
  --gold-soft: #f8eed8;
  --ok: #1c7a52;
  --ok-soft: #e2f3ea;
  --warn: #8f5e05;
  --warn-soft: #fbf0d6;
  --err: #b4342d;
  --err-soft: #fae6e4;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 28, 43, .05);
  --shadow: 0 1px 2px rgba(15, 28, 43, .04), 0 8px 24px -8px rgba(15, 28, 43, .10);
  --shadow-lg: 0 2px 6px rgba(15, 28, 43, .05), 0 24px 48px -16px rgba(15, 28, 43, .22);
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-3); text-decoration: none; }
a:hover { color: var(--brand-2); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
h1, h2, .display { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; font-optical-sizing: auto; }
h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.hidden, [hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; }
::selection { background: var(--gold-soft); }

/* Düzen */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 520px) { .wrap { padding: 0 16px; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 18px; }
.grid2, .grid3, .grid4 { display: grid; gap: 4px 16px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 24px; }
@media (max-width: 520px) { .card.pad { padding: 18px; } }
.card h3 { margin-bottom: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; font-weight: 800; margin: 0 0 18px; }
.card-title .num { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.lform .card + .card, .lform .card + .row { margin-top: 16px; }

/* Butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font: 700 14px/1 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .18s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-2); color: #fff; box-shadow: 0 6px 18px -6px rgba(11, 37, 64, .55); }
.btn.accent { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn.accent:hover:not(:disabled) { color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 20px -8px rgba(196, 138, 23, .7); }
.btn.ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink-2); color: var(--ink); }
.btn.light { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); color: #fff; }
.btn.light:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.btn.danger { background: var(--err); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.ok:hover:not(:disabled) { color: #fff; filter: brightness(1.08); }
.btn.sm { min-height: 34px; padding: 0 13px; font-size: 13px; }
.btn.lg { min-height: 52px; padding: 0 28px; font-size: 15px; }
.btn.block { width: 100%; }
.btn .ico { width: 17px; height: 17px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand-3); font: inherit; font-weight: 700; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(36, 90, 143, .35); outline-offset: 2px; }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: .8rem; font-weight: 700; color: var(--ink-2); letter-spacing: .01em; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 12px;
  background: #fff; color: var(--ink); font: 500 15px/1.4 var(--font); transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236b7684' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center; }
textarea { resize: vertical; min-height: 100px; }
input::placeholder, textarea::placeholder { color: #a3abb4; }
input:hover, select:hover, textarea:hover { border-color: #c4bdae; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-3); box-shadow: 0 0 0 4px rgba(36, 90, 143, .12); }
input:disabled { background: var(--bg); color: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .93rem; }
.check input { width: 18px; height: 18px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 6px 0 18px; }
.checks .check { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s; }
.checks .check:has(input:checked) { border-color: var(--brand-3); background: var(--brand-soft); }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 9px 20px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--muted); transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(15, 28, 43, .14); }
.seg input:focus-visible + span { outline: 3px solid rgba(36, 90, 143, .35); }

/* Fotoğraf yöneticisi */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ph { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.loading { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: .85rem; }
.ph .cover { position: absolute; left: 8px; bottom: 8px; background: var(--gold); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; letter-spacing: .03em; }
.ph-act { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; }
.ph-act button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(15, 28, 43, .7); color: #fff; cursor: pointer; font-size: 12px; backdrop-filter: blur(4px); }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--line-2); border-radius: 14px; background: #fcfbf8; cursor: pointer; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand-3); background: var(--brand-soft); color: var(--brand-2); }
.dropzone b { color: var(--ink); }
.dropzone .ico { width: 30px; height: 30px; color: var(--brand-3); }
.sticky-actions { margin-top: 18px; }

/* Rozetler */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--bg-2); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-pending { background: var(--warn-soft); color: var(--warn); }
.st-published, .st-approved, .st-active { background: var(--ok-soft); color: var(--ok); }
.st-rejected, .st-blocked { background: var(--err-soft); color: var(--err); }
.st-done, .st-closed, .st-passive { background: #eceae4; color: #5b6570; }

/* İlan kartı */
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.lcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; box-shadow: var(--shadow-sm); transition: transform .25s ease, box-shadow .25s ease, border-color .25s; }
.lcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; color: inherit; }
.lcard-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(150deg, #e4e9ee, #f3efe6); }
.lcard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.lcard:hover .lcard-img img { transform: scale(1.05); }
.lcard-img::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to top, rgba(8, 20, 34, .55), transparent); pointer-events: none; }
.noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: #b8c2cc; }
.noimg svg { width: 64px; height: 64px; }
.tag { position: absolute; z-index: 1; left: 12px; top: 12px; padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; color: #fff; background: var(--brand); }
.tag.kiralik { background: rgba(11, 37, 64, .88); backdrop-filter: blur(6px); }
.tag.satilik { background: var(--gold); }
.tag.star { left: auto; right: 12px; background: rgba(255, 255, 255, .92); color: var(--gold); }
.tag.d3 { left: auto; right: 12px; top: auto; bottom: 14px; background: rgba(11, 37, 64, .88); color: var(--gold-2); backdrop-filter: blur(6px); letter-spacing: .08em; }
.lcard .price-on { position: absolute; z-index: 1; left: 14px; bottom: 12px; color: #fff; font-weight: 800; font-size: 1.28rem; letter-spacing: -.01em; text-shadow: 0 1px 8px rgba(0, 0, 0, .3); }
.lcard .price-on small { font-size: .8rem; font-weight: 600; opacity: .85; }
.lcard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lcard h3 { font-size: 1rem; font-weight: 700; margin: 0; color: var(--ink); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lcard .loc { display: flex; align-items: center; gap: 5px; font-size: .85rem; color: var(--muted); }
.lcard .loc .ico { width: 15px; height: 15px; }
.specs { list-style: none; padding: 12px 0 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; border-top: 1px solid var(--line); margin-top: 10px; }
.specs li { display: inline-flex; align-items: center; gap: 6px; font-size: .83rem; font-weight: 700; color: var(--ink-2); }
.specs .ico { width: 16px; height: 16px; color: var(--gold); }

/* Tablo */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbfaf7; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fbfaf6; }

/* Boş durum, yükleniyor */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .empty-ico { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); display: flex; align-items: center; justify-content: center; }
.empty .empty-ico svg { width: 34px; height: 34px; }
.empty h2, .empty h3 { color: var(--ink); }
.empty p { max-width: 440px; margin-left: auto; margin-right: auto; }
.spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: flex; justify-content: center; padding: 90px 0; color: var(--muted); }
.skel { background: linear-gradient(90deg, #ece8df 25%, #f5f2eb 37%, #ece8df 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: var(--radius); }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Bildirim, modal */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: calc(100vw - 36px); }
.toast { padding: 13px 18px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, .22); font-size: .93rem; font-weight: 600; transition: opacity .4s, transform .4s; border-left: 4px solid var(--gold-2); }
.toast.err { background: #2b1513; border-left-color: #f0645b; }
.toast.warn { border-left-color: var(--gold-2); }
.toast.ok { border-left-color: #4cc38a; }
.toast.out { opacity: 0; transform: translateY(6px); }
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(500px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); color: var(--ink); }
dialog.modal::backdrop { background: rgba(8, 20, 34, .55); backdrop-filter: blur(3px); }
.modal-body { padding: 26px; }
.modal-body h3 { font-family: var(--display); font-size: 1.3rem; font-weight: 600; margin-bottom: 14px; }

.alert { display: flex; gap: 10px; padding: 14px 16px; border-radius: 14px; font-size: .93rem; margin-bottom: 16px; line-height: 1.5; }
.alert .ico { margin-top: 1px; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--brand-soft); color: var(--brand-2); }
.alert a { font-weight: 700; }

/* 3D görüntüleyici (site ilan sayfası + fpanel) */
.v3d-card { overflow: hidden; }
.v3d-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 18px 20px 14px; }
.v3d-head .card-title { display: flex; align-items: center; gap: 8px; }
.v3d-head .card-title .ico { color: var(--gold); }
.v3d-note { margin: 0; padding: 10px 20px 14px; }
.v3d { display: flex; flex-direction: column; background: radial-gradient(120% 90% at 50% 0%, #fbf9f4, #e9e4da); }
.v3d-stage { position: relative; height: clamp(320px, 56vw, 520px); touch-action: none; overflow: hidden; }
.v3d-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.v3d-stage canvas:active { cursor: grabbing; }
.v3d-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 700; }
.v3d-labels { position: absolute; inset: 0; pointer-events: none; }
.v3d-label { position: absolute; left: 0; top: 0; padding: 4px 10px; border-radius: 999px; background: rgba(11, 37, 64, .86); color: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; text-align: center; line-height: 1.25; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.v3d-label small { display: block; font-size: 10.5px; font-weight: 600; color: var(--gold-2); }
.v3d-label small:empty { display: none; }
.v3d-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.v3d-bar .grow { flex: 1; }
.v3d-bar button { border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 6px 14px; font: 700 13px var(--font); cursor: pointer; }
.v3d-bar button:hover { border-color: var(--ink-2); color: var(--ink); }
.v3d-bar button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.v3d:fullscreen, .v3d.v3d-full { position: fixed; inset: 0; z-index: 100; }
.v3d:fullscreen .v3d-stage, .v3d.v3d-full .v3d-stage { height: auto; flex: 1; }
