/* admin.css - Basvuru yonetim paneli (admin & bayi gorunumu icin ortak) */

#page-admin{ padding:0; }
.ap-shell{ max-width:1280px; margin:0 auto; padding:24px 18px 60px; }
.ap-head{ display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; flex-wrap:wrap }
.ap-head-left h1{ margin:0; font-size:1.55rem; font-weight:800; letter-spacing:-.4px; color:var(--text) }
.ap-head-left p{ margin:4px 0 0; color:var(--muted); font-size:.92rem }
.ap-head-right{ display:flex; align-items:center; gap:10px }
.ap-user{ font-weight:700; color:var(--text); padding:8px 14px; border-radius:12px; background:#f0f4fa; font-size:.86rem }
.ap-btn{ background:linear-gradient(135deg,#0d2540,#16385f); color:#fff; border:none; padding:10px 16px; border-radius:12px; font-weight:700; cursor:pointer; font-size:.85rem; transition:transform .15s,box-shadow .18s }
.ap-btn:hover{ transform:translateY(-1px); box-shadow:0 8px 22px rgba(13,37,96,.28) }
.ap-btn-ghost{ background:#fff; border:1px solid var(--line); color:var(--text); padding:10px 14px; border-radius:12px; font-weight:600; cursor:pointer; font-size:.84rem }
.ap-btn-ghost:hover{ background:#f3f6fb }

/* Tabs */
.ap-tabs{ display:flex; gap:6px; padding:6px; background:#fff; border:1px solid var(--line); border-radius:14px; overflow-x:auto; margin-bottom:14px; scrollbar-width:thin }
.ap-tab{ display:inline-flex; align-items:center; gap:8px; padding:9px 14px; border-radius:10px; border:none; background:transparent; cursor:pointer; font-weight:700; font-size:.86rem; color:#5a6b86; white-space:nowrap; transition:background .15s,color .15s }
.ap-tab:hover{ background:#f3f6fb }
.ap-tab.active{ background:#0d2540; color:#fff }
.ap-tab.active .ap-tab-count{ background:rgba(255,255,255,.18); color:#fff }
.ap-tab-count{ display:inline-grid; place-items:center; min-width:22px; height:20px; padding:0 6px; border-radius:999px; background:#eef2f8; color:#5a6b86; font-size:.72rem; font-weight:800 }

.ap-dot{ width:8px; height:8px; border-radius:50% }
.ap-dot.s-yeni{ background:#2563eb }
.ap-dot.s-arandi{ background:#0ea5e9 }
.ap-dot.s-islemde{ background:#a855f7 }
.ap-dot.s-evrak_bekleniyor{ background:#f59e0b }
.ap-dot.s-bankaya_gonderildi{ background:#14979a }
.ap-dot.s-onaylandi{ background:#16a34a }
.ap-dot.s-reddedildi{ background:#dc2626 }
.ap-dot.s-satis{ background:#0d9488 }
.ap-dot.s-iptal{ background:#64748b }

/* Filter row */
.ap-filter-row{ display:grid; grid-template-columns:1.4fr 1fr auto auto auto auto; gap:10px; margin-bottom:14px }
.ap-filter-row input, .ap-filter-row select{ width:100%; padding:11px 14px; border:1px solid var(--line); border-radius:12px; background:#fff; font:inherit; font-size:.9rem; color:var(--text) }
.ap-filter-row input:focus, .ap-filter-row select:focus{ outline:none; border-color:var(--accent) }

/* List */
.ap-list{ display:flex; flex-direction:column; gap:10px }
.ap-empty{ background:#fff; border:1px dashed var(--line); border-radius:14px; padding:30px; text-align:center; color:var(--muted) }
.ap-empty-mini{ padding:14px; text-align:center; color:var(--muted); font-size:.88rem }

.ap-row{ background:#fff; border:1px solid var(--line); border-radius:16px; overflow:hidden; transition:box-shadow .15s,border-color .15s }
.ap-row:hover{ box-shadow:0 4px 16px rgba(13,35,64,.06); border-color:rgba(15,30,58,.14) }
.ap-row-main{ display:grid; grid-template-columns:1.2fr 1.4fr auto; gap:16px; padding:14px 16px; cursor:pointer; align-items:center }
.ap-row-l{ display:flex; flex-direction:column; gap:4px }
.ap-row-id{ color:var(--muted); font-size:.75rem; font-weight:600 }
.ap-row-name{ font-size:1rem; color:var(--text) }
.ap-row-meta{ display:flex; flex-wrap:wrap; gap:6px; align-items:center }
.ap-row-meta i{ font-style:normal; font-size:.76rem; padding:3px 9px; border-radius:999px; background:#eef2f8; color:#3b4f73; font-weight:600 }
.ap-row-meta i.ap-bayi{ background:rgba(20,151,154,.12); color:#0f5457 }
.ap-row-c{ display:flex; flex-direction:column; gap:3px; min-width:0 }
.ap-row-c strong{ font-size:.92rem; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.ap-row-c small{ font-size:.78rem; color:var(--muted) }
.ap-row-r{ display:flex; flex-direction:column; align-items:flex-end; gap:6px }
.ap-assigned{ font-size:.74rem; color:var(--muted); font-weight:600 }
.ap-assigned.ap-noassign{ opacity:.6 }
.ap-row-actions{ display:flex; gap:8px; padding:0 16px 12px; flex-wrap:wrap }
.ap-mini{ display:inline-flex; align-items:center; gap:5px; padding:7px 11px; border-radius:10px; background:#f3f6fb; color:#0d2540; font-size:.78rem; font-weight:700; text-decoration:none; transition:background .15s }
.ap-mini:hover{ background:#e4ebf5; color:#0d2540 }
.ap-mini-wa{ background:rgba(37,211,102,.12); color:#0f7339 }
.ap-mini-wa:hover{ background:rgba(37,211,102,.22) }

/* Status badges */
.ap-badge{ display:inline-block; padding:5px 11px; border-radius:999px; font-size:.74rem; font-weight:800; letter-spacing:.2px }
.ap-badge.s-yeni{ background:rgba(37,99,235,.12); color:#1d4ed8 }
.ap-badge.s-arandi{ background:rgba(14,165,233,.14); color:#0369a1 }
.ap-badge.s-islemde{ background:rgba(168,85,247,.14); color:#7e22ce }
.ap-badge.s-evrak_bekleniyor{ background:rgba(245,158,11,.16); color:#b45309 }
.ap-badge.s-bankaya_gonderildi{ background:rgba(20,151,154,.16); color:#0f5457 }
.ap-badge.s-onaylandi{ background:rgba(22,163,74,.14); color:#15803d }
.ap-badge.s-reddedildi{ background:rgba(220,38,38,.14); color:#b91c1c }
.ap-badge.s-satis{ background:rgba(13,148,136,.16); color:#115e59 }
.ap-badge.s-iptal{ background:rgba(100,116,139,.18); color:#475569 }

/* Row left border tint by status */
.ap-row.s-yeni{ border-left:4px solid #2563eb }
.ap-row.s-arandi{ border-left:4px solid #0ea5e9 }
.ap-row.s-islemde{ border-left:4px solid #a855f7 }
.ap-row.s-evrak_bekleniyor{ border-left:4px solid #f59e0b }
.ap-row.s-bankaya_gonderildi{ border-left:4px solid #14979a }
.ap-row.s-onaylandi{ border-left:4px solid #16a34a }
.ap-row.s-reddedildi{ border-left:4px solid #dc2626 }
.ap-row.s-satis{ border-left:4px solid #0d9488 }
.ap-row.s-iptal{ border-left:4px solid #64748b }

/* Detail overlay */
.ap-overlay{ position:fixed; inset:0; background:rgba(10,20,35,.55); backdrop-filter:blur(6px); display:none; align-items:flex-start; justify-content:center; z-index:1100; overflow-y:auto; padding:24px }
.ap-overlay.active{ display:flex }
.ap-detail{ width:min(960px,100%); background:#fff; border-radius:24px; box-shadow:0 28px 80px rgba(0,0,0,.22); overflow:hidden; margin:20px 0 40px }
.ap-detail-head{ display:flex; justify-content:space-between; align-items:center; padding:18px 22px; border-bottom:1px solid var(--line); position:sticky; top:0; background:#fff; z-index:3 }
.ap-detail-head small{ display:block; color:var(--muted); font-size:.78rem; font-weight:600 }
.ap-detail-head h2{ margin:4px 0 0; font-size:1.35rem; font-weight:800; color:var(--text) }
.ap-close{ width:40px; height:40px; border-radius:12px; border:none; background:#eef4fb; color:var(--primary); font-size:22px; cursor:pointer; font-weight:700 }
.ap-close:hover{ background:#dde7f3 }
.ap-detail-body{ padding:20px 22px 28px }
.ap-dt-grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px }
.ap-dt-section{ background:#fafcff; border:1px solid var(--line); border-radius:16px; padding:16px 18px }
.ap-dt-section h3{ margin:0 0 12px; font-size:.92rem; font-weight:800; text-transform:uppercase; letter-spacing:.5px; color:var(--muted) }
.ap-dt-section dl{ margin:0; display:grid; grid-template-columns:1fr 1.4fr; gap:6px 12px }
.ap-dt-section dt{ color:var(--muted); font-size:.82rem; font-weight:600 }
.ap-dt-section dd{ margin:0; color:var(--text); font-weight:700; font-size:.9rem; word-break:break-word }
.ap-dt-controls{ display:flex; flex-direction:column; gap:10px }
.ap-field{ display:flex; flex-direction:column; gap:6px }
.ap-field span{ font-size:.78rem; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:.3px }
.ap-field select, .ap-field input{ padding:10px 12px; border:1px solid var(--line); border-radius:12px; font:inherit; background:#fff; color:var(--text); font-size:.92rem }
.ap-link{ color:var(--accent); font-weight:700; text-decoration:none; margin-right:8px }
.ap-link:hover{ text-decoration:underline }
.ap-link-wa{ color:#0f7339 }
.ap-customer-note{ background:#fff; border:1px dashed var(--line); border-radius:12px; padding:10px 12px; font-size:.86rem; color:var(--text); line-height:1.5 }
.ap-dt-notes{ grid-column:span 2 }
.ap-note-form{ display:grid; grid-template-columns:1fr auto; gap:8px; margin-bottom:10px }
.ap-note-form textarea{ padding:10px 12px; border:1px solid var(--line); border-radius:12px; font:inherit; background:#fff; resize:vertical; font-size:.9rem }
.ap-note{ background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px 12px; margin-bottom:8px }
.ap-note-head{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:4px }
.ap-note-head strong{ font-size:.86rem; color:var(--text) }
.ap-note-head small{ font-size:.72rem; color:var(--muted) }
.ap-note p{ margin:0; font-size:.88rem; color:var(--text); line-height:1.5 }

/* ====================== Page nav (Basvurular / Kampanyalar) ====================== */
.ap-pagenav{ display:flex; gap:6px; padding:6px; background:#fff; border:1px solid var(--line); border-radius:14px; margin-bottom:14px; width:fit-content; max-width:100%; overflow-x:auto }
.ap-pagenav-btn{ display:inline-flex; align-items:center; gap:8px; padding:9px 16px; border-radius:10px; border:none; background:transparent; cursor:pointer; font-weight:700; font-size:.9rem; color:#5a6b86; white-space:nowrap; transition:background .15s,color .15s }
.ap-pagenav-btn:hover{ background:#f3f6fb }
.ap-pagenav-btn.is-active{ background:#0d2540; color:#fff }
.ap-pagenav-btn svg{ width:16px; height:16px }

.ap-page{ display:none }
.ap-page.is-active{ display:block }

/* ====================== Kampanya satirlari ====================== */
.ap-camp-row{
  display:grid; grid-template-columns:auto 1fr auto auto; gap:14px; align-items:center;
  padding:14px 16px; background:#fff; border:1px solid var(--line); border-radius:16px;
  transition:box-shadow .15s,border-color .15s;
}
.ap-camp-row:hover{ box-shadow:0 4px 16px rgba(13,35,64,.06); border-color:rgba(15,30,58,.14) }
.ap-camp-row.is-inactive{ opacity:.58 }
.ap-camp-preview{
  width:74px; height:74px; border-radius:14px; flex-shrink:0;
  background:linear-gradient(135deg,#0b2e68 0%,#07111f 60%,#102a52 100%);
  display:flex; align-items:center; justify-content:center;
  color:#5fe4d4; font-weight:900; font-size:1.1rem; letter-spacing:-.5px;
  border:1px solid rgba(255,255,255,.06);
}
.ap-camp-body{ min-width:0 }
.ap-camp-badge{
  display:inline-block; padding:3px 10px; border-radius:999px;
  background:rgba(20,151,154,.12); color:#0f5457;
  font-size:.7rem; font-weight:800; letter-spacing:.4px; text-transform:uppercase;
  margin-bottom:5px;
}
.ap-camp-title{ font-size:.98rem; font-weight:800; color:#0f172a; margin:0 0 4px; line-height:1.3 }
.ap-camp-desc{ font-size:.82rem; color:#5a6b86; margin:0; line-height:1.45;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.ap-camp-meta{ display:flex; gap:10px; flex-wrap:wrap; margin-top:6px; font-size:.72rem; color:#64748b; font-weight:600 }
.ap-camp-meta span{ display:inline-flex; align-items:center; gap:4px }
.ap-camp-status{ display:inline-block; padding:5px 11px; border-radius:999px; font-size:.74rem; font-weight:800 }
.ap-camp-status.active{ background:rgba(22,163,74,.14); color:#15803d }
.ap-camp-status.passive{ background:rgba(100,116,139,.18); color:#475569 }
.ap-camp-actions{ display:flex; gap:6px }
.ap-camp-actions button{
  width:34px; height:34px; border-radius:10px; border:none; background:#f3f6fb;
  color:#0d2540; cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:background .15s,color .15s;
}
.ap-camp-actions button:hover{ background:#e4ebf5 }
.ap-camp-actions button.is-danger:hover{ background:rgba(220,38,38,.14); color:#b91c1c }
.ap-camp-actions svg{ width:16px; height:16px }

/* ====================== Form grid (editor) ====================== */
.ap-form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px 16px }
.ap-form-grid .ap-field-full{ grid-column:1 / -1 }
.ap-form-grid .ap-field-checkbox{
  flex-direction:row; align-items:center; gap:10px; padding:10px 0;
}
.ap-form-grid .ap-field-checkbox input{ width:18px; height:18px; margin:0 }
.ap-form-grid .ap-field-checkbox span{ text-transform:none; font-size:.92rem; color:var(--text); font-weight:700; letter-spacing:0 }
.ap-form-grid textarea{ padding:10px 12px; border:1px solid var(--line); border-radius:12px; font:inherit; background:#fff; resize:vertical; font-size:.92rem; min-height:80px }
.ap-form-grid textarea:focus, .ap-form-grid input:focus{ outline:none; border-color:var(--accent) }
.ap-form-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:18px; padding-top:18px; border-top:1px solid var(--line); flex-wrap:wrap }
.ap-btn-danger{ background:linear-gradient(135deg,#dc2626,#b91c1c); color:#fff; border:none; padding:10px 16px; border-radius:12px; font-weight:700; cursor:pointer; font-size:.85rem; transition:transform .15s,box-shadow .18s }
.ap-btn-danger:hover{ transform:translateY(-1px); box-shadow:0 8px 22px rgba(220,38,38,.28) }

/* Mobile */
@media(max-width:900px){
  .ap-filter-row{ grid-template-columns:1fr 1fr }
  .ap-dt-grid{ grid-template-columns:1fr }
  .ap-dt-notes{ grid-column:span 1 }
  .ap-form-grid{ grid-template-columns:1fr }
  .ap-camp-row{ grid-template-columns:auto 1fr; gap:12px }
  .ap-camp-row .ap-camp-status{ grid-column:2; justify-self:start }
  .ap-camp-actions{ grid-column:1 / -1; justify-content:flex-end }
}
@media(max-width:760px){
  .ap-shell{ padding:14px 12px 60px }
  .ap-head h1{ font-size:1.25rem }
  .ap-tabs{ padding:4px; gap:4px }
  .ap-tab{ padding:8px 11px; font-size:.78rem }
  .ap-row-main{ grid-template-columns:1fr; gap:8px; padding:12px 14px }
  .ap-row-r{ flex-direction:row; align-items:center; justify-content:flex-start; gap:10px; flex-wrap:wrap }
  .ap-detail{ border-radius:0; margin:0; min-height:100vh }
  .ap-overlay{ padding:0 }
  .ap-detail-head{ border-radius:0 }
  .ap-note-form{ grid-template-columns:1fr }
  .ap-filter-row{ grid-template-columns:1fr }
}
