/* eKolayServis — Web Yönetim Paneli. Aynı design system (design/DESIGN-NOTES.md) */
:root {
  --yellow: #FFCC00;
  --blue: #2934FF;
  --text: #000000;
  --text-2: #1E1E1E;
  --text-muted: #4A5565;
  --text-subtle: #364153;
  --text-gray: #99A1AF;
  --bg-light: #F9FAFB;
  --bg-gray: #F3F4F6;
  --bg-cream: #FFF7ED;
  --border-2: #E5E7EB;
  --success: #22C55E;
  --error: #EF4444;
  --warning: #F97316;
  --r-sm: 4px; --r-md: 8px; --r-lg: 10px; --r-xl: 14px; --r-xxl: 16px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, .1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* DT-17 — panelin tek bir açık teması var. Bunu bildirmezsek cihaz koyu moddayken
     tarayıcı form alanlarına koyu tema varsayılanlarını (beyaz yazı) uygular ve
     açık zeminli kutularda yazı görünmez olur. */
  color-scheme: light;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* DT-17 — form alanları rengi tarayıcı varsayılanından değil, temadan gelsin */
input, select, textarea, button { color: var(--text-2); }
::placeholder { color: var(--text-gray); opacity: 1; }
body { font-family: var(--font); background: var(--bg-light); color: var(--text-2); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: var(--yellow); padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: var(--r-xxl);
  box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 32px 28px;
}
.login-card .logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-card .logo svg { width: 64px; height: 64px; }
.login-card h1 { font-size: 20px; font-weight: 800; text-align: center; color: var(--text); }
.login-card .sub { text-align: center; color: var(--text-muted); font-size: 13px; margin: 6px 0 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-subtle); margin-bottom: 6px; }
.field .input-ic { position: relative; }
.field .input-ic svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.field input, .field select, .field textarea {
  width: 100%; padding: 14px 14px 14px 40px; font-size: 15px; font-family: var(--font);
  border: 1px solid var(--border-2); border-radius: var(--r-sm); color: var(--text-2);
  background: #fff; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border: 2px solid #6750A4; padding: 13px 13px 13px 39px; }
.field.plain input, .field.plain select, .field.plain textarea { padding: 12px 14px; }
.field.plain input:focus, .field.plain select:focus, .field.plain textarea:focus { padding: 11px 13px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-xl); font-weight: 700; font-size: 14px;
  padding: 14px 20px; color: var(--text); background: var(--yellow); width: auto;
}
.btn.block { width: 100%; }
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: var(--r-lg); }
.btn.ghost { background: #fff; border: 2px solid var(--border-2); color: var(--text-subtle); }
.btn.blue { background: var(--blue); color: #fff; border-radius: var(--r-sm); }
.btn.danger { background: #FEF2F2; border: 1px solid #FECACA; color: var(--error); }
.btn.success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #16A34A; }
/* Durum seçici (destek kuyruğu) — ghost düğmelerle aynı yükseklik ve çerçeve;
   seçim anında kaydedilir, yanında ayrı bir düğme yoktur. */
.status-sel {
  appearance: none; -webkit-appearance: none;
  padding: 8px 32px 8px 14px; font-size: 13px; font-weight: 700; font-family: var(--font);
  color: var(--text-subtle); background-color: #fff; border: 2px solid var(--border-2);
  border-radius: var(--r-lg); line-height: 1.2; cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.status-sel:hover { border-color: var(--text-gray); }
.status-sel:focus-visible { border-color: #6750A4; }
.status-sel:disabled { opacity: .55; cursor: progress; }

.err-msg { background: #FEF2F2; border: 1px solid #FECACA; color: var(--error); font-size: 13px; padding: 10px 12px; border-radius: var(--r-md); margin-bottom: 14px; display: none; }
.err-msg.show { display: block; }
.login-foot { text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--text-gray); }
.otp-note { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); background: var(--bg-cream); border-radius: var(--r-md); padding: 8px 10px; }

/* ---------- App shell ---------- */
.app { display: none; min-height: 100vh; }
.app.active { display: block; }
.topbar {
  position: sticky; top: 0; z-index: 40; background: var(--yellow);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; min-height: 58px; box-shadow: 0 1px 0 rgba(0,0,0,.06);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.topbar .brand svg { width: 30px; height: 30px; }
.topbar .brand b { font-size: 16px; font-weight: 800; }
.topbar .brand .tag {
  background: #1E1E1E; color: var(--yellow); font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px; letter-spacing: .3px;
}
.topbar .who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #1E1E1E; }
.topbar .who b { font-weight: 700; }
.topbar .who button { background: #1E1E1E; color: #fff; border: 0; border-radius: var(--r-lg); padding: 7px 13px; font-size: 12.5px; font-weight: 600; }
@media (max-width: 620px) { .topbar .who span { display: none; } }

.layout { display: grid; grid-template-columns: 1fr; }
@media (min-width: 980px) { .layout { grid-template-columns: 224px 1fr; min-height: calc(100vh - 58px); } }

.sidenav {
  display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px;
  background: #fff; border-bottom: 1px solid var(--border-2);
  scrollbar-width: none;
}
.sidenav::-webkit-scrollbar { display: none; }
@media (min-width: 980px) {
  .sidenav {
    flex-direction: column; border-bottom: 0; border-right: 1px solid var(--border-2);
    padding: 20px 14px; overflow: visible;
  }
}
.sidenav button {
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  background: none; border: 0; border-radius: var(--r-lg);
  padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-subtle);
  text-align: left;
}
.sidenav button svg { flex: none; }
.sidenav button:hover { background: var(--bg-gray); }
.sidenav button.active { background: var(--yellow); color: var(--text); font-weight: 700; }
.sidenav .badge {
  margin-left: auto; background: var(--error); color: #fff; font-size: 10.5px; font-weight: 700;
  border-radius: 20px; padding: 1px 7px; min-width: 18px; text-align: center;
}

.main { padding: 24px 20px 48px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h2 { font-size: 21px; font-weight: 800; color: var(--text); }
.page-head p { width: 100%; color: var(--text-muted); font-size: 13.5px; margin-top: 2px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar input, .toolbar select {
  padding: 10px 12px; font-size: 13.5px; font-family: var(--font);
  border: 1px solid var(--border-2); border-radius: var(--r-md); background: #fff; outline: none; color: var(--text-2);
}
.toolbar input:focus, .toolbar select:focus { border-color: #6750A4; }
.toolbar input[type="search"] { min-width: 220px; flex: 1; max-width: 340px; }

/* Kartlar */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); margin-bottom: 24px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(6, 1fr); } }
.scard { background: #fff; border-radius: var(--r-xxl); box-shadow: var(--shadow-card); padding: 16px; }
.scard b { display: block; font-size: 24px; font-weight: 800; color: var(--text); }
.scard span { font-size: 12px; color: var(--text-muted); }
.scard .delta { font-size: 11px; color: var(--success); font-weight: 600; }

.panel { background: #fff; border-radius: var(--r-xxl); box-shadow: var(--shadow-card); padding: 20px; margin-bottom: 20px; }
.panel h3 { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 12px; }
/* Künye/detay panellerindeki ikincil metin tablo içindekiyle aynı görünsün */
.panel .sub { display: block; font-size: 11.5px; color: var(--text-gray); }
.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Tablolar */
.tbl-wrap { overflow-x: auto; background: #fff; border-radius: var(--r-xxl); box-shadow: var(--shadow-card); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-gray); padding: 12px 14px; border-bottom: 1px solid var(--border-2); background: var(--bg-light); }
td { padding: 12px 14px; border-bottom: 1px solid var(--bg-gray); vertical-align: middle; color: var(--text-subtle); }
tr:last-child td { border-bottom: 0; }
td .name { font-weight: 700; color: var(--text); }
/* Künyeye giden tıklanabilir kullanıcı adı (satırda ayrı "Detay" düğmesi yok) */
td button.name-link {
  display: inline-block; background: none; border: 0; padding: 0; margin: 0;
  font: inherit; font-weight: 700; color: var(--text); text-align: left; cursor: pointer;
  white-space: normal; /* DT-19 — uzun talep başlıkları da bu düğmeyi kullanıyor, satır kırılsın */
}
td button.name-link:hover { color: var(--blue); text-decoration: underline; }
td button.name-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: var(--r-sm); }
td .sub { display: block; font-size: 11.5px; color: var(--text-gray); }
td .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap;
}
.chip.warning { background: var(--bg-cream); color: var(--warning); }
.chip.success { background: #F0FDF4; color: #16A34A; }
.chip.error { background: #FEF2F2; color: var(--error); }
.chip.gray { background: var(--bg-gray); color: var(--text-muted); }
.chip.blue { background: #EEF0FF; color: var(--blue); }

.empty { text-align: center; padding: 48px 20px; color: var(--text-gray); font-size: 14px; }
.empty svg { margin: 0 auto 12px; display: block; opacity: .5; }
.module-missing {
  background: var(--bg-cream); border: 1px dashed var(--warning); border-radius: var(--r-xxl);
  padding: 36px 24px; text-align: center; color: var(--text-subtle); font-size: 14px;
}
.module-missing b { display: block; font-size: 16px; color: var(--warning); margin-bottom: 6px; }

/* Harita grupları */
.map-groups { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 20px; }
@media (min-width: 700px) { .map-groups { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .map-groups { grid-template-columns: repeat(3, 1fr); } }
.map-group { background: #fff; border-radius: var(--r-xxl); box-shadow: var(--shadow-card); padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.map-group .pin { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; }
.map-group b { font-size: 15px; color: var(--text); display: block; }
.map-group .cnt { font-size: 12.5px; color: var(--text-muted); }
.map-group .provs { font-size: 11.5px; color: var(--text-gray); margin-top: 4px; }

/* Modal + toast */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: var(--r-xxl); width: 100%; max-width: 460px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.modal p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px; }
.modal textarea { width: 100%; min-height: 105px; background: var(--bg-light); color: var(--text-2); border: 1px solid var(--border-2); border-radius: var(--r-xl); padding: 12px; font-family: var(--font); font-size: 14px; outline: none; resize: vertical; }
.modal textarea:focus { border-color: #6750A4; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* DT-19 — ek görseller indirilmek yerine sayfa içinde büyütülerek gösterilir */
button.img-btn {
  display: inline-block; background: none; border: 0; padding: 0; margin: 0; cursor: zoom-in; line-height: 0;
}
button.img-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: var(--r-sm); }
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 300;
  display: none; align-items: center; justify-content: center; padding: 28px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-lg); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox .close {
  position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.9); color: #1E1E1E; font-size: 22px; line-height: 1; cursor: pointer;
}

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: #1E1E1E; color: #fff; font-size: 13.5px; padding: 12px 20px; border-radius: var(--r-lg);
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--error); }

.doc-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; }
.announce-preview { background: var(--bg-light); border: 1px solid var(--border-2); border-radius: var(--r-xl); padding: 14px; font-size: 13px; color: var(--text-subtle); }
.announce-preview b { display: block; color: var(--text); margin-bottom: 4px; }

/* Puantaj kalem tablosu — taslak sürümlerde satır içi düzenleme (PAY-03) */
.py-in {
  width: 92px;
  padding: 6px 8px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font: inherit;
  font-size: 12.5px;
  background: #fff;
}
.py-in:focus { border-color: #6750A4; outline: none; }
.py-in[type="checkbox"] { width: auto; }

/* Belge zorunluluk matrisi — geniş tablo içinde okunaklı satır içi alanlar */
.dr-in {
  min-width: 105px;
  padding: 6px 8px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font: inherit;
  font-size: 12.5px;
  background: #fff;
}
.dr-in:focus { border-color: #6750A4; outline: none; }
.dr-in[type="checkbox"] { min-width: auto; width: auto; padding: 0; }
.dr-checks { display: grid; gap: 5px; min-width: 145px; }
.dr-checks label { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; }
