/* MedicamineAds — Medicamine uygulamasının tasarım dili.
 *
 * Renkler, yazı tipleri, köşe yarıçapı ve gölgeler doğrudan medicamine-app'in
 * tailwind.config.js dosyasından alındı; iki ürün tek aile gibi görünsün diye.
 * Ana uygulamada koyu mod yok — burada da yok.
 */

:root {
  /* --- medicamine-app/tailwind.config.js --- */
  --bg: #fff9f7;            /* background */
  --surface: #ffffff;       /* card */
  --surface-2: #fdf6f8;
  --border: #e7d6dc;        /* border */
  --text: #24151c;          /* foreground */
  --muted: #6f5962;         /* muted-foreground */
  --muted-bg: #f6eef0;      /* muted */
  --accent: #9b1b52;        /* primary */
  --accent-ink: #ffffff;    /* primary-foreground */
  --accent-soft: #f5d9e3;   /* secondary */
  --accent-soft-ink: #5a1835;
  --gold: #f3b33d;          /* accent */
  --gold-ink: #382400;
  --ok: #197b61;            /* success */
  --ok-soft: #e3f2ed;
  --warn: #9a570b;
  --warn-soft: #fdf1dc;
  --danger: #c52e3f;        /* destructive */
  --danger-soft: #fbe6e8;

  /* Grafik serileri: chart1/chart2 aynen alındı; üçüncüsü accent altının
     koyu adımı — kendi chart3 yeşilleri maviyle ayırt edilemediği için
     (normal görüşte ΔE 11,7) değiştirildi. Bu üçlü tüm çiftlerde geçiyor. */
  --series-meta: #9b1b52;
  --series-google: #276c9f;
  --series-tiktok: #c77a00;
  --grid: #f0e4e8;
  --track: #f2e6ea;
  --axis-ink: #6f5962;
  --status-good: #197b61;
  --status-critical: #c52e3f;

  --radius: 16px;           /* --radius: 16px */
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(155, 27, 82, .05), 0 2px 8px rgba(155, 27, 82, .05);
  --shadow-lg: 0 12px 32px rgba(155, 27, 82, .14);   /* uygulamadaki kart gölgesi */
  --sidebar: #24151c;
}

* { box-sizing: border-box; }

/* .rec gibi display kuralı olan sınıflar tarayıcının [hidden] varsayılanını
   ezdiği için açıkça bastırıyoruz — katlanan listeler buna dayanıyor. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

h1, h2, h3, .owner-headline, .kpi-card .value, .chart-head .hero, .owner-card .v {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

/* ---------------------------------------------------------------- kenar çubuğu */

.sidebar {
  width: 232px; flex: 0 0 232px;
  background: var(--sidebar); color: #d6c4cb;
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.sidebar .brand {
  font-family: "Manrope", sans-serif;
  color: #fff; font-weight: 700; font-size: 16px;
  padding: 6px 10px 18px; letter-spacing: -.01em;
}
.sidebar .brand small { display: block; color: #9c8790; font-weight: 400; font-size: 12px; }
.sidebar a {
  display: block; padding: 9px 12px; border-radius: var(--radius-sm);
  color: #d6c4cb; font-size: 14px; font-weight: 500; text-decoration: none;
}
.sidebar a:hover { background: #3a2530; color: #fff; }
.sidebar a.active { background: var(--accent); color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .foot { font-size: 12px; color: #8e7a83; padding: 10px; line-height: 1.6; }
.sidebar .foot a { display: inline; padding: 0; color: #a8949c; text-decoration: underline; }

/* -------------------------------------------------------------------- içerik */

.main { flex: 1; min-width: 0; padding: 24px 28px 56px; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 23px; margin: 0; letter-spacing: -.02em; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head .grow { flex: 1; }

/* ------------------------------------------------------------------ bileşenler */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
}
.card h2 {
  font-size: 15px; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 700;
}
.card h2 .hint {
  font-family: "DM Sans", sans-serif;
  font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px;
}

.grid { display: grid; gap: 14px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.kpi-card .label {
  color: var(--muted); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 600;
}
.kpi-card .value { font-size: 25px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.kpi-card .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi-card .note { font-size: 12px; color: var(--muted); margin-top: 4px; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--accent-soft); color: var(--accent-soft-ink); }
.badge.mute { background: var(--muted-bg); color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 7px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; min-width: 170px; }
th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; background: var(--surface-2);
  position: sticky; top: 0;
}
tbody tr:hover { background: var(--surface-2); }
td.pos { color: var(--ok); font-weight: 700; }
td.neg { color: var(--danger); font-weight: 700; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
th.sticky-end, td.sticky-end {
  position: sticky; right: 0; background: var(--surface);
  border-left: 1px solid var(--border); text-align: right;
}
th.sticky-end { background: var(--surface-2); z-index: 2; }
tbody tr:hover td.sticky-end { background: var(--surface-2); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  text-decoration: none; box-shadow: 0 1px 2px rgba(155,27,82,.04);
}
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: #d9c2ca; }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 14px rgba(155, 27, 82, .2);
}
.btn.primary:hover { background: #851646; }
.btn.small { padding: 5px 11px; font-size: 12.5px; }
.btn.danger { color: var(--danger); border-color: #eec6cb; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Panelin üst sırasındaki eylem butonları */
.actionbar {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px;
}
.actionbar .sep { width: 1px; height: 24px; background: var(--border); margin: 0 3px; }
.actionbar .grow { flex: 1; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 500;
  color: var(--muted); text-decoration: none;
}
.chip:hover { text-decoration: none; border-color: #d9c2ca; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.rec { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.rec:last-child { border-bottom: 0; padding-bottom: 0; }
.rec .bar { width: 3px; border-radius: 3px; flex: 0 0 3px; }
.rec.critical .bar { background: var(--danger); }
.rec.warning .bar { background: var(--warn); }
.rec.opportunity .bar { background: var(--ok); }
.rec.info .bar { background: var(--accent); }
.rec .body { flex: 1; min-width: 0; }
.rec .title { font-weight: 700; font-size: 14px; font-family: "Manrope", sans-serif; }
.rec .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rec .detail { font-size: 13px; color: #4a3a41; margin-top: 5px; line-height: 1.55; }
.rec .acts { margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap; }

/* Uzun listeler kapalı başlar; "tümünü göster" ile açılır. */
.more-toggle {
  display: block; width: 100%; margin-top: 12px; text-align: center;
  padding: 9px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer;
}
.more-toggle:hover { background: var(--surface-2); color: var(--accent); }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.bar-row .name { width: 150px; flex: 0 0 150px; color: var(--muted); font-weight: 500; }
.bar-row .track { flex: 1; height: 9px; background: var(--track); border-radius: 999px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 999px; }
.bar-row .val { width: 112px; text-align: right; font-variant-numeric: tabular-nums; }

form.stack { display: grid; gap: 13px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
label .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font: inherit; font-size: 14px;
  background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-soft); border-color: var(--accent);
}
textarea { min-height: 76px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.notice {
  padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13.5px;
  border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 14px;
  line-height: 1.55;
}
.notice.warn { background: var(--warn-soft); border-color: #f0dcb8; color: #7a4508; }
.notice.danger { background: var(--danger-soft); border-color: #f0c9cd; color: #8f2029; }
.notice.info { background: var(--accent-soft); border-color: #eec4d3; color: var(--accent-soft-ink); }

.variant {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px; margin-bottom: 12px; background: var(--surface);
}
.variant .angle { font-size: 12px; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.variant .field { margin-bottom: 9px; }
.variant .field .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.variant .field .v { font-size: 14px; margin-top: 3px; white-space: pre-wrap; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 16px; }
.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; display: inline-block;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; }
.toast {
  background: var(--sidebar); color: #fff; padding: 12px 16px;
  border-radius: var(--radius-sm); font-size: 13.5px;
  box-shadow: var(--shadow-lg); max-width: 380px;
}
.toast.err { background: var(--danger); }

.dot-live {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); margin-left: 5px; vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(243,179,61,.25);
}

/* ------------------------------------------------------------------ grafikler */

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-text { fill: var(--axis-ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .series-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .series-area { opacity: .1; }
.chart .end-label { font-size: 11px; font-weight: 700; }
.chart .ref-line { stroke: var(--axis-ink); stroke-width: 1; stroke-dasharray: 4 4; opacity: .6; }
.chart .ref-text { fill: var(--axis-ink); font-size: 10.5px; }
.chart .crosshair { stroke: var(--axis-ink); stroke-width: 1; opacity: .45; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .bubble { stroke: var(--surface); stroke-width: 2; opacity: .85; cursor: pointer; }
.chart .bubble:hover { opacity: 1; stroke: var(--text); }
.chart .hit { fill: transparent; cursor: crosshair; }

.chart-tip {
  position: absolute; pointer-events: none; z-index: 20;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 9px 11px; font-size: 12.5px; min-width: 150px;
  opacity: 0; transition: opacity .1s;
}
.chart-tip.on { opacity: 1; }
.chart-tip .tip-head { font-weight: 700; margin-bottom: 5px; font-size: 12px; font-family: "Manrope", sans-serif; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.chart-tip .tip-row .sw { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.chart-tip .tip-row .k { color: var(--muted); }
.chart-tip .tip-row .v { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.chart-tip .tip-row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 5px; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12.5px; }
.legend .item { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.legend .item .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend .item b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

.chart-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.chart-head .hero { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.chart-empty { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }

/* ------------------------------------------------------------------- giriş */

.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card { width: 100%; max-width: 360px; }

/* ------------------------------------------- salon sahibi görünümü (sade) */

.owner-wrap { max-width: 720px; margin: 0 auto; padding: 22px 18px 60px; }
.owner-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }
.owner-top .chips { margin-left: auto; }
.owner-brand { font-family: "Manrope", sans-serif; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.owner-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.owner-status {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; background: var(--surface); box-shadow: var(--shadow-lg);
}
.owner-status .light { width: 14px; height: 14px; border-radius: 50%; margin-top: 6px; flex: 0 0 14px; }
.owner-status.good .light { background: var(--ok); box-shadow: 0 0 0 5px rgba(25,123,97,.15); }
.owner-status.watch .light { background: var(--gold); box-shadow: 0 0 0 5px rgba(243,179,61,.22); }
.owner-status.bad .light { background: var(--danger); box-shadow: 0 0 0 5px rgba(197,46,63,.15); }
.owner-headline { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.owner-explain { color: var(--muted); font-size: 14.5px; margin-top: 4px; line-height: 1.55; }

.owner-sentence { font-size: 16.5px; line-height: 1.65; margin: 22px 2px 20px; }

.owner-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.owner-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.owner-card .k { color: var(--muted); font-size: 13px; }
.owner-card .v { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.owner-card .h { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.45; }

.owner-block { margin-top: 30px; }
.owner-block h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 700; }

.owner-list { list-style: none; padding: 0; margin: 0; }
.owner-list li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 14px 44px; margin-bottom: 10px; position: relative;
  font-size: 15px; line-height: 1.55; box-shadow: var(--shadow);
}
.owner-list li::before { position: absolute; left: 17px; top: 13px; font-size: 15px; font-weight: 800; }
.owner-list.done li::before { content: "✓"; color: var(--ok); }
.owner-list.watch li::before { content: "!"; color: var(--warn); }

.owner-note { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin-top: 10px; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .sidebar .brand { padding: 0 12px 0 4px; }
  .sidebar .brand small { display: none; }
  .sidebar .spacer, .sidebar .foot { display: none; }
  .main { padding: 16px; }
  .row2 { grid-template-columns: 1fr; }
  .bar-row .name { width: 100px; flex: 0 0 100px; }
}

@media (max-width: 520px) {
  .owner-wrap { padding: 16px 14px 48px; }
  .owner-headline { font-size: 18px; }
  .owner-sentence { font-size: 15.5px; }
  .owner-card .v { font-size: 23px; }
}

/* ------------------------------------------------------- toplu düzenleme */

th.pick, td.pick { width: 34px; min-width: 34px; text-align: center; padding: 8px 4px; }
td.pick input, th.pick input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
tr.picked { background: var(--accent-soft) !important; }

.bulkbar {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  padding: 12px 16px; margin-bottom: 14px;
  background: var(--accent); color: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  position: sticky; top: 10px; z-index: 30;
}
.bulkbar .sep { width: 1px; height: 22px; background: rgba(255,255,255,.3); }
.bulkbar .grow { flex: 1; }
.bulkbar strong { font-family: "Manrope", sans-serif; font-size: 14px; }
.bulkbar .btn {
  background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff;
}
.bulkbar .btn:hover { background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.5); }
.bulkbar .btn.danger { color: #ffd9dd; border-color: rgba(255,217,221,.45); }

.bulk-row { display: flex; gap: 8px; font-size: 13px; padding: 4px 0; }
.bulk-row .mark { width: 16px; flex: 0 0 16px; font-weight: 700; }
.bulk-row.ok .mark { color: var(--ok); }
.bulk-row.err .mark { color: var(--danger); }

/* --------------------------------------------------------- strateji taslağı */

.draft {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; background: var(--surface-2); margin-bottom: 14px;
}
.draft-title {
  font-family: "Manrope", sans-serif; font-weight: 700; font-size: 15px;
  margin-bottom: 12px; color: var(--accent);
}
.draft-row {
  display: flex; gap: 12px; padding: 6px 0; font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
.draft-row:last-child { border-bottom: 0; }
.draft-row .k { color: var(--muted); width: 130px; flex: 0 0 130px; }
.draft-row .v { flex: 1; }

/* ------------------------------------------------------------------ asistan */

.answer {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 17px; margin-bottom: 12px; background: var(--surface);
  box-shadow: var(--shadow);
}
.answer .q {
  font-family: "Manrope", sans-serif; font-weight: 700; font-size: 14px;
  color: var(--accent); margin-bottom: 8px;
}
.answer .a { font-size: 14.5px; line-height: 1.65; white-space: pre-wrap; }
.answer .refs { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.answer .refs span {
  display: inline-block; background: var(--accent-soft); color: var(--accent-soft-ink);
  padding: 2px 9px; border-radius: 999px; margin-right: 5px; font-weight: 600;
}

/* ---------------------------------------------------- finansal özet kartları
 * Üst şeritteki büyük sayılar. Her kartta tek bir renk var: eğilim iyiyse
 * yeşil, kötüyse kırmızı, kayda değer değişim yoksa nötr. Renk tek başına
 * anlam taşımasın diye yanında her zaman ok işareti ve yüzde bulunur.
 *
 * Kartlar sabit üç satırlık bir ızgara: başlık / sayı+grafik / eğilim.
 * Başlık iki satıra taştığında sayının aşağı kaymaması için başlık satırı
 * iki satırlık yüksekliğe sabitlenmiştir — böylece tüm kartlarda sayılar
 * aynı hizada durur.
 */

/* Kırılma noktaları elle seçildi. auto-fit bırakıldığında ara genişliklerde
   5 kart üstte, 1 kart altta tek başına kalıyordu. Sütun sayısı hep 6'ya
   bölünüyor: 6 → 3 → 2. Hiçbir kırılmada sütun 190px'in altına düşmüyor;
   daha darı "119.652 TRY" gibi bir sayıyı kartın dışına taşırıyordu. */
.grid.tiles { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1540px) { .grid.tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 880px)  { .grid.tiles { grid-template-columns: repeat(2, 1fr); } }

.tile {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  align-content: start;
  overflow: hidden;   /* son güvenlik ağı: hiçbir çocuk kartı aşamaz */
}
.tile .label {
  color: var(--muted); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 600;
  line-height: 1.35;
  min-height: calc(2 * 1.35em);   /* iki satır: sayılar hizalı kalsın */
}
.tile .row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.tile .value {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 23px; font-weight: 700; letter-spacing: -.02em;
  line-height: 1.1; white-space: nowrap;
}
.tile .value small {
  font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px;
}

.tile .spark {
  height: 30px; overflow: hidden;   /* çizgi kartın dışına taşmasın */
  /* Yer daralırsa küçülen taraf grafik olsun; sayı hiç kırpılmasın. */
  flex: 1 1 78px; min-width: 34px; max-width: 190px;
}
.tile .spark .line {
  fill: none; stroke: var(--ton); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke;   /* viewBox esnetilince çizgi incelmesin */
}
.tile .spark .fill { fill: var(--ton-soft); stroke: none; }

.tile .delta {
  font-size: 12px; font-weight: 700; color: var(--ton);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .delta .arrow { font-size: 10px; }
.tile .delta .vs {
  font-weight: 400; color: var(--muted); margin-left: 4px;
}

.tile.tone-iyi  { --ton: var(--ok);     --ton-soft: var(--ok-soft); }
.tile.tone-kotu { --ton: var(--danger); --ton-soft: var(--danger-soft); }
.tile.tone-notr { --ton: var(--muted);  --ton-soft: var(--muted-bg); }

.tiles-note {
  color: var(--muted); font-size: 12px; margin: 8px 2px 0; line-height: 1.5;
}

/* ------------------------------------------------------- platform sekmeleri
 * Hangi platformun verisine bakıldığını seçer. Rapor bir kez çekilir,
 * süzme sunucuda bellekte yapılır — sekme değiştirmek reklam API'lerine
 * yeni istek atmaz. Seçili sekme yalnız renkle değil, kalın çerçeve ve
 * koyu yazıyla da ayrılır.
 */

.platform-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.ptab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); text-decoration: none; font-size: 13px;
  box-shadow: var(--shadow);
}
.ptab:hover { text-decoration: none; border-color: #d9c2ca; }
.ptab .ad { font-weight: 600; }
.ptab .tutar {
  font-family: "Manrope", sans-serif; font-weight: 700; color: var(--text);
}
.ptab .nokta {
  width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px;
}
.ptab .nokta.seri-meta   { background: var(--series-meta); }
.ptab .nokta.seri-google { background: var(--series-google); }
.ptab .nokta.seri-tiktok { background: var(--series-tiktok); }
.ptab .rozet {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted);
  background: var(--muted-bg); padding: 2px 7px; border-radius: 999px;
}
.ptab.active {
  border-color: var(--accent); border-width: 2px; padding: 9px 15px;
  background: var(--accent-soft); color: var(--accent-soft-ink);
}
.ptab.active .tutar { color: var(--accent-soft-ink); }

/* ----------------------------------------------------------- eylem kartları
 * Düz düğme sırası yerine, ne işe yaradığı yazan kartlar.
 */

.eylemler {
  display: grid; gap: 12px; margin-bottom: 18px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1100px) { .eylemler { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .eylemler { grid-template-columns: 1fr; } }

.eylem {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow); color: var(--text);
  text-decoration: none; cursor: pointer; font: inherit; width: 100%;
}
.eylem:hover {
  text-decoration: none; border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}
.eylem .ikon {
  display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px;
  border-radius: 11px; background: var(--accent-soft);
  color: var(--accent); font-size: 17px;
}
.eylem .metin { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eylem .metin strong { font-size: 14px; font-weight: 700; }
.eylem .metin small { font-size: 12px; color: var(--muted); line-height: 1.4; }

.eylem.birincil { border-color: var(--accent); }
.eylem.birincil .ikon { background: var(--accent); color: var(--accent-ink); }

.demo-satiri {
  font-size: 13px; color: var(--muted); margin: 0 2px 16px;
  padding: 9px 14px; background: var(--muted-bg);
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------- sayfa başlığı
 * İkon kutusu, başlık ve sağda eylemler. Sayfanın ne olduğunu tek bakışta
 * söyler; altındaki her şey o sayfanın içeriğidir.
 */

.sayfa-karti {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.sayfa-karti .ikon {
  display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px;
  border-radius: 13px; background: var(--accent-soft);
  color: var(--accent); font-size: 20px;
}
.sayfa-karti .metin { min-width: 0; }
.sayfa-karti h1 { font-size: 21px; margin: 0; letter-spacing: -.02em; }
.sayfa-karti .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.sayfa-karti .sag { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------ etkinlik akışı */

.akis { list-style: none; margin: 0; padding: 0; }
.akis li {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.akis li:last-child { border-bottom: 0; padding-bottom: 0; }
.akis .nokta {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; margin-top: 6px;
}
.akis .nokta.ok { background: var(--ok); }
.akis .nokta.danger { background: var(--danger); }
.akis .nokta.mute { background: var(--border); }
.akis .baslik { font-size: 13.5px; font-weight: 600; }
.akis .zaman { font-size: 12px; color: var(--muted); margin-top: 2px; }
