/* Tina Kuyumculuk — Müşteri Takip
   Açık zemin, koyu ve okunaklı metin; mobil öncelikli düzen (WCAG AA hedefi). */

:root {
  --bg: #f6f4f0;
  --card: #ffffff;
  --ink: #1d1a17;
  --ink-soft: #4d453e;
  --muted: #6b6159;
  --line: #e0d9cf;
  --accent: #7a5c1e;
  --accent-soft: #f0e6d2;
  --ok: #14532d;
  --ok-soft: #e3f3e8;
  --warn: #7a4a00;
  --warn-soft: #fdf0d8;
  --danger: #8f1d1d;
  --danger-soft: #fbe5e5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 26, 23, .06), 0 6px 18px rgba(29, 26, 23, .05);
  --max: 960px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.strong { font-weight: 650; color: var(--ink); }
.big { font-size: 1.05rem; }
.center { text-align: center; }
code { background: var(--accent-soft); padding: .1rem .35rem; border-radius: 6px; font-size: .9em; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- üst bar */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-row {
  max-width: var(--max); margin: 0 auto;
  padding: .7rem 1rem .4rem;
  display: flex; flex-wrap: wrap; gap: .5rem;
  align-items: center; justify-content: space-between;
}
.brand { font-weight: 700; color: var(--ink); font-size: 1.05rem; line-height: 1.1; }
.brand small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); }
.who { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; color: var(--ink-soft);
}
.chip-role { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); font-weight: 600; }

.nav {
  max-width: var(--max); margin: 0 auto;
  padding: 0 .75rem .55rem;
  display: flex; gap: .35rem; overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a, .nav .link-btn {
  white-space: nowrap; padding: .5rem .7rem; border-radius: 10px;
  color: var(--ink-soft); font-size: .92rem; font-weight: 550;
}
.nav a:hover, .nav .link-btn:hover { background: var(--bg); text-decoration: none; }
.badge {
  background: var(--warn); color: #fff; border-radius: 999px;
  padding: 0 .4rem; font-size: .75rem; font-weight: 700;
}

/* ------------------------------------------------------------------- düzen */
.wrap { max-width: var(--max); margin: 0 auto; padding: 1rem 1rem 3rem; }
.page-head {
  display: flex; flex-wrap: wrap; gap: .6rem;
  align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem; margin-bottom: 1rem;
}
.card-narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.card-today { border-color: var(--accent); }
.cards { display: grid; gap: .85rem; }
.footer {
  max-width: var(--max); margin: 0 auto;
  padding: 0 1rem 2.5rem; color: var(--muted); font-size: .8rem;
}

/* ------------------------------------------------------------------ formlar */
.stack { display: flex; flex-direction: column; gap: .5rem; }
label { font-weight: 600; font-size: .92rem; color: var(--ink-soft); }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #cfc6b9; border-radius: 10px;
  padding: .7rem .75rem; width: 100%; min-height: 46px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--accent-soft); outline-offset: 1px; border-color: var(--accent);
}
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; margin: .25rem 0; }
.fieldset legend { font-weight: 650; font-size: .92rem; padding: 0 .35rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.req { color: var(--danger); }
.search { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.search input { flex: 1 1 14rem; }

.btn {
  font: inherit; font-weight: 620; cursor: pointer;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .6rem .9rem; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #654a15; }
.btn-danger { background: var(--danger-soft); border-color: #e2b7b7; color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-small { padding: .35rem .65rem; min-height: 40px; font-size: .9rem; }
.btn-block { width: 100%; }
.link { font-weight: 600; font-size: .9rem; }
.link-btn {
  font: inherit; background: none; border: none; cursor: pointer;
  color: var(--ink-soft); padding: .5rem .7rem; border-radius: 10px;
}
.inline-form { display: inline; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.actions-split { justify-content: space-between; }
.decide-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; flex: 1 1 auto; }
.decide-form input { flex: 1 1 10rem; }

/* ------------------------------------------------------------------ mesajlar */
.flash {
  border-radius: 12px; padding: .7rem .9rem; margin-bottom: 1rem;
  border: 1px solid var(--line); background: var(--card); font-size: .95rem;
}
.flash-ok { background: var(--ok-soft); border-color: #b9dcc6; color: var(--ok); }
.flash-warn { background: var(--warn-soft); border-color: #edd9ac; color: var(--warn); }
.flash-error { background: var(--danger-soft); border-color: #e2b7b7; color: var(--danger); }

/* ------------------------------------------------------------------ listeler */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.list-item {
  display: flex; flex-wrap: wrap; gap: .5rem;
  align-items: center; justify-content: space-between;
  padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 12px;
  background: #fffdfa;
}
.list-item-column { flex-direction: column; align-items: stretch; }
.list-main { display: flex; flex-direction: column; gap: .1rem; }
.pill {
  display: inline-block; border-radius: 999px; padding: .15rem .6rem;
  font-size: .8rem; font-weight: 650; white-space: nowrap;
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-today { background: var(--accent); color: #fff; }
.pill-sample { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* -------------------------------------------------------------------- panel */
.stats { display: grid; grid-template-columns: 1fr; gap: .75rem; margin-bottom: 1rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .85rem 1rem; box-shadow: var(--shadow);
}
.stat-num { display: block; font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* ----------------------------------------------------------------- müşteri */
.customer-card { margin: 0; }
.customer-top { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: space-between; }
.meta { margin: .6rem 0 0; display: grid; gap: .35rem; }
.meta div { display: flex; gap: .5rem; align-items: baseline; min-width: 0; }
.meta dt { color: var(--muted); font-size: .82rem; flex: 0 0 auto; min-width: 6.5rem; margin: 0; }
.meta dd {
  margin: 0; font-size: .95rem; flex: 1 1 auto; min-width: 0;
  overflow-wrap: anywhere; word-break: break-word;
}
.meta-wide dt { min-width: 7.5rem; }
.note {
  background: var(--bg); border-left: 3px solid var(--accent-soft);
  padding: .5rem .7rem; border-radius: 8px; margin: .6rem 0 0; font-size: .92rem;
}
.draft-body {
  background: var(--bg); border: 1px dashed var(--line); border-radius: 10px;
  padding: .6rem .75rem; margin: .5rem 0 0; white-space: pre-wrap; font-size: .95rem;
}

/* ------------------------------------------------------------------- sekme */
.tabs { display: flex; gap: .35rem; overflow-x: auto; margin-bottom: 1rem; }
.tabs a {
  padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-soft); font-size: .9rem; white-space: nowrap;
}
.tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }

/* Dar telefonlarda etiket ve değer alt alta: uzun e-posta/zaman damgası taşmasın. */
@media (max-width: 460px) {
  .meta div { flex-direction: column; gap: 0; }
  .meta dt, .meta-wide dt { min-width: 0; }
}

/* --------------------------------------------------------------- ekranlar */
@media (min-width: 640px) {
  body { font-size: 17.5px; }
  h1 { font-size: 1.75rem; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .wrap { padding-top: 1.5rem; }
}
