:root{
  --bg: #15130f;
  --surface: #1d1a15;
  --surface-2: #262119;
  --line: #35301f;
  --text: #f1ece0;
  --text-dim: #a89e88;
  --gold: #c9974a;
  --gold-soft: #e3bd7e;
  --ember: #8a5a2f;
  --wa: #3fae5a;
  --radius: 14px;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.glow{
  position: fixed;
  top: -320px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 640px;
  background: radial-gradient(ellipse at center, rgba(201,151,74,0.28) 0%, rgba(201,151,74,0.08) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.topbar{
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 24px 28px;
}

.brand{ display:flex; align-items:flex-start; gap: 14px; }
.brand-mark{
  font-size: 22px;
  color: var(--gold-soft);
  line-height: 1;
  margin-top: 6px;
  text-shadow: 0 0 18px rgba(227,189,126,0.6);
}
.brand-text h1{
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}
.brand-text h1 span{ color: var(--gold-soft); font-style: italic; font-weight: 400; }
.scope{
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}
.scope em{ color: var(--gold); font-style: normal; opacity:.7; margin: 0 2px;}

.stats{
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  background: rgba(255,255,255,0.02);
}
.stats b{ color: var(--gold-soft); font-weight: 700; }

main{
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.controls{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.search-wrap{
  flex: 1 1 260px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon{ position:absolute; left: 16px; color: var(--text-dim); }
#search{
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px 13px 42px;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 14.5px;
  outline: none;
  transition: border-color .15s;
}
#search::placeholder{ color: var(--text-dim); }
#search:focus{ border-color: var(--gold); }

.filters{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  align-items: flex-end;
}
.filter-field{
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.filter-field label{
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-field select{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  min-width: 140px;
  outline: none;
  cursor: pointer;
}
.filter-field select:focus{ border-color: var(--gold); }
.switch-field{ justify-content: flex-end; }

.filter-toggle{ display:flex; align-items:center; }
.switch{
  display:flex; align-items:center; gap:8px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  height: 40px;
  white-space: nowrap;
}
.switch input{ accent-color: var(--gold); width:15px; height:15px; }

.template-box{
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.template-toggle{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  padding: 13px 18px;
  cursor: pointer;
}
.template-toggle svg{ transition: transform .18s; color: var(--text-dim); }
.template-toggle.open svg{ transform: rotate(180deg); }
.template-panel{
  display: none;
  padding: 0 18px 16px;
}
.template-panel.open{ display: block; }
#templateInput{
  width: 100%;
  resize: vertical;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 12px 14px;
  outline: none;
}
#templateInput:focus{ border-color: var(--gold); }
.template-foot{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.hint{ font-size: 12px; color: var(--text-dim); }
.hint code{
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--gold-soft);
  font-family: 'Manrope', sans-serif;
}
#templateReset{
  background: none;
  border: none;
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.list{ display: flex; flex-direction: column; gap: 10px; }

.row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color .15s, transform .15s;
}
.row:hover{ border-color: #4a4327; }

.row-main{ min-width: 0; }
.firma{
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 16.5px;
  margin: 0 0 4px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.loc{
  margin: 0 0 2px;
  font-size: 11.5px;
  color: var(--gold-soft);
  opacity: .8;
  letter-spacing: 0.02em;
}
.adres{
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}
.adres:empty::before{ content: 'Adres kaydı yok'; opacity: .55; font-style: italic; }

.row-actions{ display: flex; gap: 8px; flex-shrink: 0; }
.btn{
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--text-dim);
  transition: transform .12s, border-color .12s, color .12s;
}
.btn:active{ transform: scale(0.96); }
.btn.call{ color: var(--gold-soft); border-color: var(--ember); }
.btn.call:hover{ border-color: var(--gold); color: var(--gold); }
.btn.wa{ color: var(--wa); border-color: #2c5c39; }
.btn.wa:hover{ border-color: var(--wa); }
.btn.disabled{ opacity: 0.32; pointer-events: none; }
.btn .btn-label{ display: none; }
@media (min-width: 560px){
  .btn .btn-label{ display: inline; }
}

.empty{
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  padding: 60px 0;
}

footer{
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 30px 24px 50px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.02em;
}

@media (max-width: 480px){
  .row{ flex-direction: column; align-items: stretch; }
  .row-actions{ justify-content: stretch; }
  .btn{ flex: 1; justify-content: center; }
}
