/* Duja dashboard theme.
   Brand hex (single source; mirrors duja_template.py:18-19):
     --teal  #0F5D6C  (primary)
     --gold  #B67233  (accent)                                                */
:root {
  --teal: #0F5D6C;
  --teal-dark: #0A4551;
  --gold: #B67233;
  --ink: #2E2E2E;
  --muted: #767676;
  --page: #F4F2ED;
  --border: #E4DFD4;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.55;
}
body.centered { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--teal); color: #fff; padding: 14px 28px;
  border-bottom: 3px solid var(--gold);
}
.topbar .brand { font-weight: bold; font-size: 19px; letter-spacing: 0.3px; }
.topbar nav { display: flex; align-items: center; flex-wrap: wrap; }
.topbar nav a, .topbar nav .linkbtn {
  color: #fff; text-decoration: none; margin-left: 20px; padding: 4px 2px;
  border-bottom: 2px solid transparent;
}
.topbar nav a:hover { border-bottom-color: var(--gold); }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: none; color: #fff; cursor: pointer; font-size: 15px; }

main { max-width: 1040px; margin: 28px auto; padding: 0 20px; }
main.wide { max-width: 1080px; }
h1 { font-size: 26px; margin: 0 0 18px; color: var(--teal); }
h2 { font-size: 18px; margin: 0 0 14px; color: var(--teal); }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 24px; margin-bottom: 24px;
}
.card.login { width: 320px; display: flex; flex-direction: column; gap: 14px; }
.card.login label { display: flex; flex-direction: column; font-size: 14px; gap: 4px; }

input, select, button, textarea {
  padding: 9px 10px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 5px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; }

button, .btn {
  background: var(--teal); color: #fff; border: 1px solid var(--teal);
  border-radius: 5px; cursor: pointer; text-decoration: none;
  display: inline-block; padding: 9px 16px;
}
button:hover, .btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
/* Secondary / outline variant */
button.secondary, .btn.secondary {
  background: #fff; color: var(--teal); border: 1px solid var(--teal);
}
button.secondary:hover, .btn.secondary:hover { background: #E9EFF0; }
.linkbtn:hover { background: none; }

.summary {
  display: flex; gap: 28px; flex-wrap: wrap; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; padding: 18px 20px; margin-bottom: 16px;
}
.summary .num { font-size: 24px; font-weight: bold; display: block; color: var(--teal); }
.note { color: var(--muted); font-size: 13px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; align-items: center; }

.grid { width: 100%; border-collapse: collapse; background: #fff; }
.grid th, .grid td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.grid th { background: #F2EFE8; color: var(--teal); font-weight: 600; }
.empty { color: #8B9597; text-align: center; padding: 26px; }

.badge {
  display: inline-block; white-space: nowrap;
  padding: 3px 10px; border-radius: 11px; font-size: 12px; color: #fff; background: #8a8a8a;
}
/* Durum labels start with an uppercase letter (locale-aware for tr: iade -> İade) */
.badge::first-letter { text-transform: uppercase; }
.badge.sent { background: var(--teal); }
.badge.failed { background: #9c3b34; }
.badge.bounced { background: #A9662E; }
.badge.opted-out { background: #6E6A63; }
.badge.complained { background: #9c3b34; }

/* Match labels/fields in a card whether the <form> is inside or wraps the cards (Ayarlar). */
.card label { display: flex; flex-direction: column; font-size: 14px; gap: 5px; margin-bottom: 14px; }
.card label.inline-check { flex-direction: row; align-items: center; gap: 8px; }
.card textarea, .card input, .card select { width: 100%; font-family: inherit; }
.card label.inline-check input { width: auto; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.error { color: #9c3b34; font-weight: 600; }
.ok { color: var(--teal); font-weight: 600; }
.mode-test { color: var(--teal); }
.mode-live { color: #9c3b34; }
.hero-preview { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 6px; }
.thumb { width: 84px; height: auto; border: 1px solid var(--border); border-radius: 4px; }

.row-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-form input[type=text], .row-form input[type=email] { flex: 1 1 140px; }
.row-form input[type=text], .row-form input[type=email], .row-form select { width: auto; }
.edit-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 10px; }
/* Row editor lays fields in a responsive grid inside the full-width expander. */
.grid .edit-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0; padding: 0; }
/* Stacked label/field for every .edit-form (row editors + the İmza add form). */
.edit-form label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; margin-bottom: 0; }
.edit-form label.inline-check { flex-direction: row; align-items: center; gap: 8px; }
.edit-form input, .edit-form select, .edit-form textarea { width: 100%; }
.edit-form label.inline-check input { width: auto; }

/* ============================================================================
   Aesthetic layer v3 — "refined editorial / luxury hospitality".
   Fraunces display serif + Hanken Grotesk sans, intentional teal & gold,
   layered depth, and a typographically-carried table. Overrides the utility
   base above (later rules win). Falls back to system fonts if the CDN is
   unreachable, so nothing breaks offline.
   ============================================================================ */
:root {
  --font-sans: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', ui-serif, Georgia, 'Times New Roman', serif;
  --teal: #0F5D6C;
  --teal-deep: #073A45;
  --teal-2: #17798C;
  --gold: #B67233;
  --gold-line: #D8B08A;
  --gold-soft: #EFE0D0;
  --ink: #1C1C1C;
  --muted: #6E7A7D;
  --paper: #F1F4F5;
  --card: #FFFFFF;
  --border: #DCE4E6;
  --border-soft: #EAF0F1;
  --teal-tint: #E6F0F2;
  --teal-wash: #EFF5F6;
  --shadow-sm: 0 1px 2px rgba(7, 58, 69, 0.05);
  --shadow-md: 0 2px 6px rgba(7, 58, 69, 0.06), 0 18px 40px -22px rgba(7, 58, 69, 0.28);
  --radius: 14px;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  font-size: 15px;
  letter-spacing: -0.005em;
  background:
    radial-gradient(1200px 520px at 78% -8%, rgba(182, 114, 51, 0.10), transparent 60%),
    linear-gradient(180deg, #F2F5F6 0%, #E6EDEF 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-display); font-optical-sizing: auto; }
h1 { font-size: 34px; font-weight: 600; letter-spacing: -0.015em; color: var(--teal-deep); line-height: 1.1; }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; color: var(--teal-deep); }

/* --- Topbar: deep teal with a gold hairline; serif brand, gold hover rule. --- */
.topbar {
  background: linear-gradient(103deg, #073A45 0%, #0F5D6C 62%, #17798C 100%);
  border-bottom: 1px solid rgba(182, 114, 51, 0.55);
  padding: 15px 30px;
  box-shadow: 0 6px 24px -14px rgba(7, 58, 69, 0.6);
}
.topbar .brand {
  font-family: var(--font-display); font-weight: 600; font-size: 22px;
  letter-spacing: 0.2px; color: #fff; display: inline-flex; align-items: center; gap: 9px;
}
.topbar .brand::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px rgba(182, 114, 51, 0.25);
}
.topbar nav a, .topbar nav .linkbtn {
  color: rgba(255, 255, 255, 0.82); font-family: var(--font-sans);
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  margin-left: 22px; padding: 3px 1px; border-bottom: 2px solid transparent;
  transition: color 0.16s, border-color 0.16s;
}
.topbar nav a:hover, .topbar nav .linkbtn:hover { color: #fff; border-bottom-color: var(--gold); }
.linkbtn { font-size: 14px; }

main { animation: page-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes page-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main { animation: none; } }

/* --- Cards & panels: warmer, deeper, more generous. --- */
.card, details.panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card { padding: 26px; }
details.panel > summary { font-family: var(--font-sans); font-weight: 600; color: var(--teal); padding: 14px 18px; }
details.panel > summary:hover { background: var(--teal-wash); }
details.panel .panel-body { padding: 18px; }

/* --- Stat chips: serif numerals, gold-dot separator, subtle lift. --- */
.stat-chips { gap: 10px; }
.stat-chips .chip {
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 16px; color: var(--muted); font-size: 13px; box-shadow: var(--shadow-sm);
  transition: transform 0.14s, box-shadow 0.14s;
}
.stat-chips .chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.stat-chips .chip b {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  color: var(--teal); font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.page-head { align-items: center; margin-bottom: 22px; }
.page-head h1 { margin-bottom: 10px; }

/* --- Inputs: refined, warm, gold focus ring. --- */
input, select, textarea, button, .btn { font-family: var(--font-sans); }
input, select, textarea {
  border: 1px solid var(--border); border-radius: 9px; background: #fff;
  padding: 9px 11px; font-size: 14.5px; color: var(--ink);
  box-shadow: inset 0 1px 1px rgba(7, 58, 69, 0.03); transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(182, 114, 51, 0.22);
}
.filters input, .filters select { box-shadow: none; }

/* --- Buttons: primary with depth + lift; refined ghost. --- */
button, .btn {
  background: linear-gradient(180deg, var(--teal-2), var(--teal));
  color: #fff; border: 1px solid transparent; border-radius: 10px;
  padding: 10px 18px; font-weight: 600; font-size: 14px; letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(7, 58, 69, 0.22); cursor: pointer;
  transition: transform 0.14s, box-shadow 0.14s, filter 0.14s;
}
button:hover, .btn:hover {
  filter: brightness(1.06); transform: translateY(-1px);
  box-shadow: 0 6px 18px -6px rgba(7, 58, 69, 0.4); background: linear-gradient(180deg, var(--teal-2), var(--teal));
}
button.ghost, .btn.ghost, button.secondary, .btn.secondary {
  background: #fff; color: var(--teal); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
button.ghost:hover, .btn.ghost:hover, button.secondary:hover, .btn.secondary:hover {
  background: var(--teal-wash); border-color: var(--gold-line); filter: none;
}
.topbar .linkbtn { background: none; box-shadow: none; border-radius: 0; padding: 3px 1px; }
.topbar .linkbtn:hover { background: none; transform: none; filter: none; }

/* --- Table: borderless, typographic, generous. --- */
/* border-collapse:separate + a table border-radius rounds the card WITHOUT
   overflow:hidden, so the row ⋯ menu on the last row isn't clipped. */
.grid { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); border-collapse: separate; border-spacing: 0; overflow: visible; }
.grid thead th:first-child { border-top-left-radius: var(--radius); }
.grid thead th:last-child { border-top-right-radius: var(--radius); }
.grid thead th {
  background: #fff; color: var(--muted);
  font-family: var(--font-sans); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.09em;
  padding: 15px 16px; border-bottom: 1.5px solid var(--gold-line);
}
.grid tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border-soft); font-size: 14.5px; color: var(--ink); }
.grid tbody tr:nth-child(even) { background: transparent; }
.grid tbody tr { transition: background 0.12s; }
.grid tbody tr:hover { background: var(--teal-wash); }
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody td:nth-child(2) { font-weight: 600; color: var(--teal-deep); }  /* e-mail column */
.grid td .btn, .grid td button { padding: 5px 11px; font-size: 13px; }

/* Status dot + label. */
.status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13.5px; color: var(--ink); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(140, 131, 115, 0.14); }
.status.active::before { background: #2F8A5F; box-shadow: 0 0 0 3px rgba(47, 138, 95, 0.16); }
.status.bounced::before { background: #C08A2E; box-shadow: 0 0 0 3px rgba(192, 138, 46, 0.16); }
.status.opted-out::before { background: var(--muted); }
.status.complained::before { background: #B0453B; box-shadow: 0 0 0 3px rgba(176, 69, 59, 0.16); }

/* Contextual bulk bar + toolbar. */
.actionbar { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 11px 16px; }
.actionbar strong { font-family: var(--font-sans); color: var(--teal-deep); }
.toolbar { margin-bottom: 16px; }

/* Row-action menu + help disclosures inherit the warmer surfaces. */
details.rowmenu > summary { border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--teal); box-shadow: var(--shadow-sm); }
details.rowmenu > summary:hover { background: var(--teal-wash); border-color: var(--gold-line); }
details.rowmenu .menu { border-radius: 10px; box-shadow: var(--shadow-md); }
details.help .help-body { background: var(--teal-wash); border: 1px solid var(--border-soft); }
.note { color: var(--muted); }
.ok { color: var(--teal); }
h1 + .note, h2 + .note { margin-top: -6px; }

/* --- Bulk operations: explicit scope, guarded send, live selection count. --- */
.stat-chips .chip { text-decoration: none; cursor: pointer; }
.stat-chips a.chip:hover { border-color: var(--gold-line); color: var(--ink); }

/* Scope pill in a filter-scoped panel summary. */
.panel .scope {
  font-family: var(--font-sans); font-weight: 500; font-size: 11.5px; color: var(--muted);
  background: var(--teal-wash); border: 1px solid var(--border); padding: 2px 10px;
  border-radius: 999px; margin-left: 10px; letter-spacing: 0;
}
/* The send panel is the dangerous one — mark it. */
.panel.guard { border-color: var(--gold-line); }
.panel.guard > summary { color: var(--teal-deep); }
.note.warn {
  color: #6E4423; background: #F6EBE0; border: 1px solid var(--gold-line);
  border-radius: 9px; padding: 11px 13px; font-size: 13px; line-height: 1.5;
}
.note.warn strong { color: #5E3F0C; }

/* Selection bar (checked-row scope): muted until something is selected. */
.selbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); box-shadow: var(--shadow-sm); margin-bottom: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.selbar .selcount { font-size: 13.5px; color: var(--ink); }
.selbar .selcount b {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  color: var(--teal); font-variant-numeric: tabular-nums; margin-right: 3px;
}
.selbar .seldiv { color: var(--muted); font-size: 15px; }
.selbar .selhint { font-size: 12.5px; color: var(--muted); }
.selbar:not(.is-empty) { border-color: var(--gold-line); background: var(--teal-wash); }
.selbar:not(.is-empty) .selhint { display: none; }
.selbar.is-empty .selcount b { color: var(--muted); }
.selbar.is-empty select,
.selbar.is-empty #sel-value-wrap,
.selbar.is-empty #sel-del-wrap { opacity: 0.5; }
.pager { margin-top: 14px; }

/* ============================================================================
   Design system v2 — calm, utilitarian refinement (keeps the teal/gold brand).
   Adds tokens, a page header, collapsible action panels, a refined data table,
   quiet help disclosures and a native row-action menu. Additive: existing
   classes keep working; shared classes (.grid/.note/.card/.badge) gain polish.
   ============================================================================ */
:root {
  --space: 8px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 79, 69, 0.06);
  --shadow-md: 0 4px 16px rgba(11, 79, 69, 0.08);
  --teal-tint: #E6F0F2;   /* teal @ ~8% on paper — row hover / soft fills */
  --teal-wash: #EFF5F6;
  --ok: #2F7D5B;
  --warn: #A9662E;
  --danger: #9c3b34;
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
/* The [hidden] attribute must win over display:flex/grid rules (e.g. .inline-check). */
[hidden] { display: none !important; }

/* Topbar: a touch quieter, sticky so nav is always reachable on long lists. */
.topbar { position: sticky; top: 0; z-index: 20; padding: 12px 28px; box-shadow: var(--shadow-sm); }
.topbar nav a { font-size: 14.5px; opacity: 0.92; transition: opacity 0.15s; }
.topbar nav a:hover { opacity: 1; }

h1 { letter-spacing: -0.01em; }

/* Softer cards with a subtle lift. */
.card { border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* Quieter help text + collapsible help disclosures replace always-on paragraphs. */
.note { font-size: 12.5px; line-height: 1.5; }
details.help { margin: 8px 0 0; }
details.help > summary {
  cursor: pointer; color: var(--muted); font-size: 12.5px; list-style: none;
  display: inline-flex; align-items: center; gap: 6px; user-select: none;
}
details.help > summary::-webkit-details-marker { display: none; }
details.help > summary::before { content: "ⓘ"; color: var(--gold); font-style: normal; }
details.help[open] > summary { color: var(--teal); }
details.help .help-body {
  margin-top: 8px; padding: 12px 14px; background: var(--teal-wash);
  border-radius: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.55;
}
details.help .help-body strong { color: var(--ink); }

/* Page header: title + inline stat chips on the left, primary actions on the right. */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 { margin: 0 0 6px; }
.page-head .head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-chips .chip {
  display: inline-flex; align-items: baseline; gap: 6px; background: #fff;
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 13px;
  font-size: 12.5px; color: var(--muted); box-shadow: var(--shadow-sm);
}
.stat-chips .chip b { font-size: 15px; color: var(--teal); font-variant-numeric: tabular-nums; }

/* Collapsible action panel — the summary is a button; the form hides until opened. */
details.panel {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px; box-shadow: var(--shadow-sm); overflow: hidden;
}
details.panel > summary {
  cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; gap: 9px; padding: 12px 16px;
  font-weight: 600; font-size: 14px; color: var(--teal);
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after {
  content: "›"; margin-left: auto; font-size: 18px; color: var(--muted);
  transform: rotate(90deg); transition: transform 0.18s ease;
}
details.panel[open] > summary { border-bottom: 1px solid var(--border); }
details.panel[open] > summary::after { transform: rotate(-90deg); }
details.panel > summary:hover { background: var(--teal-wash); }
details.panel .panel-body { padding: 16px; }
details.panel .panel-body > .note:first-child { margin-top: 0; }

/* Toolbar row (filters left, export/actions right). */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.toolbar .spacer { flex: 1 1 auto; }
.filters { margin: 0; flex: 1 1 auto; }
.filters input, .filters select { font-size: 14px; padding: 8px 10px; }

/* Slim contextual bar (bulk-edit on checked rows). */
.actionbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--teal-wash); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 12px; font-size: 13.5px;
}
.actionbar strong { color: var(--teal); }

/* Refined data table: zebra, hover, sticky header, tabular numbers. */
/* overflow must stay visible so the last row's ⋯ menu isn't clipped; the rounded
   card comes from border-collapse:separate + border-radius (see aesthetic layer). */
.grid { border-radius: var(--radius); overflow: visible; box-shadow: var(--shadow-sm); font-variant-numeric: tabular-nums; }
.grid thead th {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 11px 12px; border-bottom: 1px solid var(--border);
}
.grid tbody tr:nth-child(even) { background: #F6F9FA; }
.grid tbody tr:hover { background: var(--teal-tint); }
.grid td { border-bottom: 1px solid #EFEBE1; vertical-align: middle; }
.grid tbody tr:last-child td { border-bottom: none; }
.grid td .btn, .grid td button { padding: 5px 10px; font-size: 13px; }

/* Status as a colored dot + label. */
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #8B9597; }
.status.active::before { background: var(--ok); }
.status.bounced::before { background: var(--warn); }
.status.opted-out::before { background: var(--muted); }
.status.complained::before { background: var(--danger); }

/* Native (JS-free) row-action menu. */
details.rowmenu { display: inline-block; position: relative; }
details.rowmenu > summary {
  cursor: pointer; list-style: none; padding: 4px 10px; border-radius: 5px;
  border: 1px solid var(--border); background: #fff; color: var(--teal); font-weight: 700;
}
details.rowmenu > summary::-webkit-details-marker { display: none; }
details.rowmenu > summary:hover { background: var(--teal-wash); }
details.rowmenu .menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-md); padding: 6px; min-width: 180px; text-align: left;
}
details.rowmenu .menu form { margin: 0; }
details.rowmenu .menu button, details.rowmenu .menu .btn {
  display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--ink); padding: 8px 10px; border-radius: 5px; font-size: 13.5px; box-shadow: none;
}
details.rowmenu .menu button:hover, details.rowmenu .menu .btn:hover { background: var(--teal-wash); }
details.rowmenu .menu .menu-note { display: block; padding: 8px 10px; font-size: 12px; line-height: 1.4; color: #A9662E; }

/* Secondary/ghost button for lower-emphasis actions. */
button.ghost, .btn.ghost {
  background: #fff; color: var(--teal); border: 1px solid var(--border);
}
button.ghost:hover, .btn.ghost:hover { background: var(--teal-wash); border-color: var(--teal); }

/* ============================================================================
   Page-specific layers (İçerik, Ayarlar). Appended last so they win ordering.
   ============================================================================ */

/* İçerik — per-language editors as collapsible panels. */
/* The form no longer lives in a .card, so restate the stacked-label layout. */
.content-form label { display: flex; flex-direction: column; font-size: 14px; gap: 5px; margin-bottom: 14px; }
.content-form label.inline-check { flex-direction: row; align-items: center; gap: 8px; }
.content-form textarea, .content-form input[type=text], .content-form input[type=email] { width: 100%; }
.content-form label.inline-check input { width: auto; }
.lang-panel > summary { font-family: var(--font-display); font-size: 17px; font-weight: 600; }

/* Sending state for mail-send buttons. */
button.is-sending, .btn.is-sending {
  cursor: progress; opacity: 0.9; animation: send-pulse 1s ease-in-out infinite;
}
button.is-sending::before { content: ""; display: inline-block; width: 12px; height: 12px;
  margin-right: 8px; vertical-align: -1px; border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff; border-radius: 50%; animation: send-spin 0.7s linear infinite; }
@keyframes send-pulse { 50% { opacity: 0.65; } }
@keyframes send-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  button.is-sending, .btn.is-sending { animation: none; }
  button.is-sending::before { animation: none; }
}
.lang-panel .lang-code { font-family: var(--font-sans); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.lang-panel.is-source { border-color: var(--gold-line); box-shadow: 0 0 0 1px var(--gold-line), var(--shadow-sm); }
.lang-panel textarea { min-height: 72px; }
.badge.source { background: var(--gold); color: #3B2F10; }

/* İmzalar — "Planlı imza" marker shown next to the signature name. */
.planli-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  color: #6E4423; background: #F6EBE0; border: 1px solid var(--gold-line);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap; vertical-align: middle;
}

/* Ayarlar — prominent send-mode banner + a clean schedule readout. */
.mode-banner {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 10px;
  font-weight: 600; font-size: 14.5px; margin-bottom: 4px;
}
.mode-banner::before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.mode-banner.is-test { background: var(--teal-wash); color: var(--teal-deep); border: 1px solid var(--border); }
.mode-banner.is-test::before { background: var(--ok); }
.mode-banner.is-live { background: #FBECEA; color: #7C2D26; border: 1px solid #E7C3BD; }
.mode-banner.is-live::before { background: var(--danger); }
.schedule-dates { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.schedule-dates li {
  font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--ink);
  background: var(--teal-wash); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px;
}

/* Zamanlama — plain-language summary, day-chip picker, next-send preview. */
.sched-summary {
  font-size: 15px; color: var(--teal-deep); background: var(--teal-wash);
  border: 1px solid var(--border); border-left: 3px solid var(--gold);
  border-radius: 8px; padding: 11px 14px; margin: 0 0 18px;
}
.sched-summary b { color: var(--teal); font-variant-numeric: tabular-nums; }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 7px; max-width: 560px; margin-bottom: 16px; }
.day-chip {
  padding: 9px 0; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 500;
  background: #fff; color: var(--muted); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: none; cursor: pointer; transition: all 0.12s;
}
.day-chip:hover { border-color: var(--gold-line); background: var(--teal-wash); transform: none; filter: none; }
.day-chip.on {
  background: linear-gradient(180deg, var(--teal-2), var(--teal)); color: #fff;
  border-color: transparent; font-weight: 600; box-shadow: 0 1px 2px rgba(7, 58, 69, 0.22);
}
.sched-preview { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.sched-preview-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }

/* Isınma — plan stepper + health meters. */
.warmup-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.warmup-steps .wstep {
  font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 600; color: var(--muted);
  background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
}
/* Past steps: muted + dashed, NOT a "completed 50" claim (the number is a cap). */
.warmup-steps .wstep.past { color: var(--muted); background: #fff; border-style: dashed; }
.warmup-steps .wstep.current {
  color: #fff; background: linear-gradient(180deg, var(--teal-2), var(--teal));
  border-color: transparent; box-shadow: 0 1px 2px rgba(7, 58, 69, 0.22);
}
.warmup-steps .wstep.current em {
  font-style: normal; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; margin-left: 7px; opacity: 0.85;
}
.warmup-steps .wsep { color: var(--muted); }
.health-meters { display: flex; gap: 20px; flex-wrap: wrap; margin: 6px 0 12px; }
.health-meters .meter { flex: 1 1 220px; }
.health-meters .meter-head { font-size: 13.5px; color: var(--ink); margin-bottom: 6px; }
.health-meters .meter-head b { color: var(--teal); font-variant-numeric: tabular-nums; }
.health-meters .meter-track { height: 8px; background: #EDE7DA; border-radius: 999px; overflow: hidden; }
.health-meters .meter-track i { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width 0.3s; }
.health-meters .meter.over .meter-head b { color: var(--danger); }
.health-meters .meter.over .meter-track i { background: var(--danger); }

/* Settings save footer — the button clearly belongs to the form. */
.form-footer { margin: 4px 0 22px; padding-top: 6px; }
.form-footer button { padding: 11px 24px; font-size: 15px; }
.settings-form .card:last-of-type { margin-bottom: 18px; }
