/*
 * LOYALLIQ CRM - uslub.
 *
 * MOBIL EVVEL: satici bunu telefonda islÉ™dir. Genis ekran qaydalari
 * asagida, media bloklarinda.
 */

:root {
  --kok: #0f766e;
  --kok-tund: #115e59;
  --kok-acik: #ccfbf1;
  --qirmizi: #b91c1c;
  --qirmizi-acik: #fee2e2;
  --sari: #b45309;
  --sari-acik: #fef3c7;
  --yasil: #15803d;
  --yasil-acik: #dcfce7;

  --metn: #111827;
  --metn-sonuk: #6b7280;
  --xett: #e5e7eb;
  --fon: #f9fafb;
  --kart: #ffffff;

  --radius: 10px;
  --kolge: 0 1px 3px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--metn);
  background: var(--fon);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--kok-tund); }

/* ---------- Skelet ---------- */

.ust {
  background: var(--kok);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;           /* ⚠️ min-width:0 TEK BASINA kifayet etmir:
                                qabin min-content eni usaqlarin CEMI qalir.
                                wrap ile en boyuk TEK usaga enir. */
  position: sticky;
  top: 0;
  z-index: 20;
}

.ust a { color: #fff; text-decoration: none; }
.ust .logo { font-weight: 700; font-size: 18px; margin-inline-end: auto; }

.ust nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.ust nav a {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  white-space: nowrap;
}
.ust nav a:hover, .ust nav a.aktiv { background: rgba(255, 255, 255, .18); }

.govde {
  max-width: 960px;
  margin-inline: auto;       /* ⚠️ unudulsa sutun sol kenara yapisir */
  padding: 16px;             /* yan bosluq - her enda en azi 16px */
}

/* Genis monitorda sehife "telefon ekrani" kimi gorunmesin:
   ic elementler darалır, sehifenin ozu yox. */
@media (min-width: 1100px) {
  .govde { max-width: 1100px; }
}

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 24px 0 12px; }

/* ---------- Kartlar ---------- */

.kart {
  background: var(--kart);
  border: 1px solid var(--xett);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--kolge);
}

.kart-bas {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.kart-bas h2 { margin: 0; }
.kart-bas .sag { margin-left: auto; }  /* ⚠️ justify-content qutunun YERINI teyin etmir */

/* ---------- Formalar ---------- */

.saheler {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sahe {
  flex: 1 1 200px;
  min-width: 0;              /* ⚠️ flex usagi defolt min-content-den kicilmir */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sahe.tam { flex-basis: 100%; }

/* ⚠️ placeholder ETIKET DEYIL - doldurulan kimi itir.
   Her sahenin gorunen etiketi var. */
.sahe label {
  font-size: 13px;
  font-weight: 600;
  color: var(--metn-sonuk);
}

input, select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--xett);
  border-radius: 8px;
  background: #fff;
  color: var(--metn);
  width: 100%;
  min-width: 0;              /* ⚠️ <select> en uzun secimine gore acilir */
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--kok);
  outline-offset: -1px;
}

textarea { min-height: 70px; resize: vertical; }

.kicik { font-size: 13px; color: var(--metn-sonuk); }

/* ---------- Duymeler ---------- */

.duyme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  min-height: 44px;          /* toxunma hedefi - telefonda barmaq ucun */
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--kok);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.duyme:hover { background: var(--kok-tund); }
.duyme:disabled { opacity: .55; cursor: default; }

.duyme.ikinci { background: #fff; color: var(--metn); border-color: var(--xett); }
.duyme.ikinci:hover { background: var(--fon); }
.duyme.tehlukeli { background: var(--qirmizi); }
.duyme.yasil { background: var(--yasil); }
.duyme.boyuk { width: 100%; font-size: 17px; min-height: 52px; }

/* Cedvel setrindeki duyme - kicik gorunur, amma toxunma hedefi
   40px-den ASAGI DUSMUR. Olculdu: inline uslubla 34px idi ve telefonda
   yan setre dusmek asan olurdu. Inline uslub yazmayin - o, bu qaydani
   ustelêyir ve qusur sessizce qayidir. */
.duyme.sira { min-height: 40px; padding: 8px 12px; font-size: 14px; }

.duymeler { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Mesajlar ---------- */

.mesaj {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid;
}
.mesaj.xeta { background: var(--qirmizi-acik); border-color: #fca5a5; color: #7f1d1d; }
.mesaj.ugur { background: var(--yasil-acik); border-color: #86efac; color: #14532d; }
.mesaj.xeberdarliq { background: var(--sari-acik); border-color: #fcd34d; color: #78350f; }

/* ---------- Cedvel ---------- */

.cedvel-qab { overflow-x: auto; }   /* ⚠️ cedvel genis ola biler, SEHIFE yox */

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 10px 8px; text-align: start; border-bottom: 1px solid var(--xett); }
th { font-size: 13px; color: var(--metn-sonuk); font-weight: 600; white-space: nowrap; }
tr.legv td { color: var(--metn-sonuk); text-decoration: line-through; }

.reqem { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Musteri siyahisi (axtaris neticesi) ---------- */

.netice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--xett);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  min-height: 60px;
}
.netice:hover { border-color: var(--kok); }

.netice .ad {
  font-weight: 600;
  /* ⚠️ text-overflow TEK BASINA hec ne etmir - overflow:hidden mecburidir */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.netice .orta { min-width: 0; flex: 1 1 auto; }
.netice .bonus { margin-left: auto; white-space: nowrap; font-weight: 700; color: var(--kok); }

/* ---------- Reqem lovheleri ---------- */

.lovheler {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* ⚠️ 1fr deyil, minmax(0,...) mentiqi */
  gap: 12px;
}

.lovhe {
  background: var(--kart);
  border: 1px solid var(--xett);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 0;
}
.lovhe .bas { font-size: 13px; color: var(--metn-sonuk); }
.lovhe .deyer { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Nisanlar ---------- */

.nisan {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--fon);
  border: 1px solid var(--xett);
  white-space: nowrap;
}
.nisan.yasil { background: var(--yasil-acik); border-color: #86efac; color: #14532d; }
.nisan.sari { background: var(--sari-acik); border-color: #fcd34d; color: #78350f; }
.nisan.qirmizi { background: var(--qirmizi-acik); border-color: #fca5a5; color: #7f1d1d; }

/* ---------- Musteri kart sehifesi (PWA) ---------- */

.kart-sehife { max-width: 480px; margin-inline: auto; padding: 16px; }

.bonus-lovhe {
  background: linear-gradient(135deg, var(--kok), var(--kok-tund));
  color: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.bonus-lovhe .mebleg { font-size: 40px; font-weight: 700; line-height: 1.1; }
.bonus-lovhe .alt { opacity: .9; font-size: 14px; margin-top: 6px; }

/* ---------- Giris sehifesi ---------- */

.giris-sehife {
  /* Fon sade ag deyil - ekran "yarimciq yuklenmis" kimi gorunmesin */
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(15, 118, 110, .16), transparent 60%),
    linear-gradient(180deg, #f4f7f7 0%, var(--fon) 55%);
  min-height: 100vh;
}

.giris-qab {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;   /* ⚠️ yan bosluq her enda en azi 16px */
}

.giris-kart {
  width: 100%;
  max-width: 400px;
  background: var(--kart);
  border: 1px solid var(--xett);
  border-radius: 16px;
  padding: 28px 24px 22px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .04);
}

.giris-bas { text-align: center; margin-bottom: 22px; }

.giris-nisan {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--kok), var(--kok-tund));
  box-shadow: 0 6px 16px rgba(15, 118, 110, .3);
}

.giris-bas h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  /* ⚠️ Uzun dukan adi bir sozdurse kenara cixmasin */
  overflow-wrap: anywhere;
}

.giris-alt { margin: 6px 0 0; font-size: 14px; color: var(--metn-sonuk); }

.giris-forma { display: flex; flex-direction: column; gap: 14px; }
.giris-forma .duyme.boyuk { margin-top: 4px; }

/* Sifre sahesi + "Goster" duymesi */
.sifre-qutu { position: relative; display: flex; min-width: 0; }
.sifre-qutu input { padding-inline-end: 84px; }

.sifre-goz {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  /* Toxunma hedefi 40px-den asagi dusmur - sahenin oz hundurluyu 44px,
     yeni icinde 2px bosluqla yerlesir. Olculdu: 34px idi. */
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--xett);
  border-radius: 7px;
  background: var(--fon);
  color: var(--metn-sonuk);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.sifre-goz:hover { color: var(--metn); background: #fff; }

.giris-qeyd {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--metn-sonuk);
}

/* ---------- Kicik ekran ---------- */

@media (max-width: 560px) {
  .govde { padding: 12px; }
  h1 { font-size: 20px; }
  .duymeler .duyme { flex: 1 1 140px; }
}

@media print {
  .ust, .duymeler, .cap-gizle { display: none !important; }
  body { background: #fff; }
}
