:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --panel-3: #eef1f5;
  --line: #dde3ec;
  --line-strong: #cbd5e1;
  --text: #202632;
  --muted: #667085;
  --soft-muted: #8a95a6;
  --accent: #e50914;
  --accent-dark: #b80710;
  --accent-soft: #fff1f2;
  --accent-2: #2563eb;
  --success: #12a668;
  --success-soft: #ecfdf5;
  --warning: #d78b00;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 12px 28px rgba(16, 24, 40, 0.08);
  --ring: 0 0 0 3px rgba(229, 9, 20, 0.14);
}

* {
  box-sizing: border-box;
}

::selection {
  background: rgba(229, 9, 20, 0.14);
}

a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 22px 16px;
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.7), 12px 0 28px rgba(16, 24, 40, 0.04);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: #111827;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand span:last-child {
  display: grid;
  gap: 2px;
}

.brand small {
  color: var(--soft-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  box-shadow: 0 8px 18px rgba(229, 9, 20, 0.24);
}

.nav {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-title {
  padding: 0 11px 4px;
  color: var(--soft-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(229, 9, 20, 0.18);
  color: var(--text);
}

.nav-item.active {
  color: var(--accent-dark);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item svg,
button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 2.2;
}

.content {
  margin-left: 248px;
  min-height: 100vh;
  padding: 30px 32px 40px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.head-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.head-actions label {
  min-width: 160px;
}

h1,
h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  color: #151b26;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(229, 9, 20, 0.18);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 650;
}

.pill.muted {
  color: var(--muted);
  border-color: var(--line);
  background: var(--panel-2);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  gap: 14px;
  align-items: end;
  max-width: 1080px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.field-help {
  color: var(--soft-muted);
  font-size: 11px;
  line-height: 1.35;
}

.scrape-strategy {
  max-width: 1080px;
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.strategy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.toggle-row {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 750;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.term-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.term-editor-head,
.term-add {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.term-editor-head strong {
  font-size: 13px;
}

.term-editor-head span {
  color: var(--muted);
  font-size: 12px;
}

.term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.term-chip {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 11px;
  border: 1px solid rgba(229, 9, 20, 0.18);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.term-chip button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(229, 9, 20, 0.12);
  color: var(--accent-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.term-add input {
  max-width: 360px;
}

.term-summary {
  max-width: 280px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

/* [hidden] tarayicinin varsayilan stilinde display:none demek, ama ustteki
   'label { display: grid }' gibi acik display kurallari onu eziyor. Bu yuzden
   hidden'i acikca zorluyoruz - yoksa gizlemek istedigimiz alanlar gorunur
   kaliyor. */
[hidden] {
  display: none !important;
}

select,
textarea,
input[type="text"],
input[type="password"],
input[type="search"],
input[type="datetime-local"],
input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

select,
input[type="text"],
input[type="password"],
input[type="search"],
input[type="datetime-local"],
input[type="number"] {
  height: 42px;
  padding: 0 10px;
}

select:focus,
textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

textarea {
  min-height: 360px;
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
}

/* Filtre ekrani disindaki kisa metin alanlari icin. Ustteki 360px oraya gore
   ayarli; not kutusu onu miras alirsa pencereyi ekrandan tasirir. */
.note-input {
  min-height: 96px;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(229, 9, 20, 0.18);
}

.secondary-button {
  background: var(--panel);
  border-color: var(--line);
  color: #344054;
  box-shadow: var(--shadow-sm);
}

.danger-button {
  background: var(--danger-soft);
  border-color: rgba(220, 38, 38, 0.24);
  color: var(--danger);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
}

.secondary-button:hover:not(:disabled),
.danger-button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.icon-button {
  width: 36px;
  padding: 0;
  background: var(--panel);
  border-color: var(--line);
}

.progress-area {
  max-width: 1080px;
  margin-top: 28px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--line);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff6b6b);
  transition: width 180ms ease;
}

.table-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

.list-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

/* Ozet ve sayfalama satiri: filtreler esit bolunsun ama bunlar yapissin. */
.list-toolbar:has(.pagination) {
  grid-template-columns: auto 1fr auto;
}

.list-actions-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.list-actions-toolbar .inline-check {
  flex: 0 0 auto;
}

.list-actions-toolbar .list-summary {
  margin-left: auto;
}

.list-summary {
  align-self: center;
  color: var(--muted);
  font-size: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination span {
  min-width: 54px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0 20px;
}

.table-footer.compact {
  margin: 14px 0 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  background: #f8fafc;
}

td {
  font-size: 14px;
  background: var(--panel);
}

tbody tr:nth-child(even) td {
  background: #fff7f7;
}

tbody tr:hover td {
  background: #fff1f2;
}

tbody tr.clickable-row {
  cursor: pointer;
}

tbody tr.clickable-row:focus-visible td {
  outline: 2px solid rgba(229, 9, 20, 0.28);
  outline-offset: -2px;
  background: #fff1f2;
}

tbody tr.row-opening td {
  background: #ffe8ea;
}

tr:last-child td {
  border-bottom: 0;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.check-cell {
  width: 88px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

dialog {
  width: min(640px, calc(100vw - 32px));
  /* Pencere ekrana sigsin. Yoksa sinirsiz uzuyor ve alttaki Gecmis bolumu
     laptop ekranlarinda tamamen gorunmez oluyordu. */
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow-md);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 14px;
  /* Pencere kayarken baslik ve kapat butonu hep erisilebilir kalsin. */
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
}

dl {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  margin: 0;
  padding: 16px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.masked-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(229, 9, 20, 0.18);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.masked-phone svg {
  width: 14px;
  height: 14px;
}

/* ---------- Giris ekrani ---------- */

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.06), transparent 34%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.login-card .brand {
  margin-bottom: 4px;
}

.login-hint {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.login-card form {
  display: grid;
  gap: 16px;
}

.login-error {
  padding: 10px 12px;
  border: 1px solid var(--danger);
  border-radius: 6px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 13px;
}

/* ---------- Durum rozetleri ---------- */

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--panel-2);
}

.status-badge[data-status="yeni"]               { color: var(--muted); }
.status-badge[data-status="araniyor"],
.status-badge[data-status="gorusuluyor"],
.status-badge[data-status="toplanti_planlandi"],
.status-badge[data-status="teklif_verildi"]     { color: var(--accent-2); border-color: rgba(37, 99, 235, 0.26); background: #eff6ff; }
.status-badge[data-status="ulasilamadi"],
.status-badge[data-status="tekrar_aranacak"]    { color: var(--warning); border-color: rgba(215, 139, 0, 0.3); background: var(--warning-soft); }
.status-badge[data-status="kazanildi"]          { color: var(--success); border-color: rgba(18, 166, 104, 0.26); background: var(--success-soft); }
.status-badge[data-status="kaybedildi"]         { color: var(--danger); border-color: rgba(220, 38, 38, 0.26); background: var(--danger-soft); }

.status-badge svg,
.lock-badge svg {
  width: 14px;
  height: 14px;
  margin-right: 5px;
}

/* ---------- Kilit rozetleri ---------- */

.lock-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.lock-badge.free  { color: var(--muted); }
.lock-badge.mine  { color: var(--success); background: var(--success-soft); }
.lock-badge.held  { color: var(--muted); background: var(--panel-2); }
.lock-badge.warn  { color: var(--warning); background: var(--warning-soft); cursor: help; }

.lead-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.lead-score.hot {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.lead-score.strong {
  color: var(--success);
  border-color: rgba(18, 166, 104, 0.32);
  background: var(--success-soft);
}

.lead-score.mid {
  color: var(--warning);
  border-color: rgba(215, 139, 0, 0.32);
  background: var(--warning-soft);
}

.lead-score.low {
  color: var(--muted);
}

/* ---------- Uyari kutusu (otomatik dusen kilit) ---------- */

.warn-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(215, 139, 0, 0.32);
  border-radius: 8px;
  background: var(--warning-soft);
  font-size: 13px;
  line-height: 1.55;
}

.warn-box strong { color: #92400e; }
.warn-box p { margin: 8px 0 12px; }

/* ---------- Kilit kutusu ve geri sayim ---------- */

.lock-box {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.lock-box.urgent {
  border-color: rgba(215, 139, 0, 0.32);
  background: var(--warning-soft);
}

.lock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.lock-countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--success);
}

.lock-countdown.urgent,
.lock-box.urgent .lock-countdown { color: var(--warning); }

.lock-box .hint { margin: 8px 0 0; }

/* ---------- Zaman cizelgesi ---------- */

.timeline-wrap { margin-top: 24px; }

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.timeline-head h3 { margin: 0; font-size: 14px; color: var(--muted); font-weight: 600; }

.timeline-filter {
  width: auto;
  min-width: 170px;
  height: 34px;
  font-size: 12px;
}

.timeline { display: grid; gap: 10px; }

.timeline-item {
  padding: 10px 12px;
  border-left: 2px solid var(--line);
  background: var(--panel-2);
  border-radius: 0 6px 6px 0;
}

/* Notlar asil icerik: goz once onlara gitsin. */
.timeline-item.is-note-item { border-left-color: var(--accent); background: #fffafa; }

.timeline-meta { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.timeline-text { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.timeline-text.is-note { color: var(--text); white-space: pre-wrap; }

.timeline-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-pager button { height: 32px; padding: 0 12px; font-size: 12px; }

/* ---------- Toast ---------- */

.toast-area {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: grid;
  gap: 8px;
  max-width: 380px;
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  transition: opacity 0.4s, transform 0.4s;
}

.toast-ok    { border-color: rgba(18, 166, 104, 0.3); }
.toast-error { border-color: var(--danger); }
.toast-out   { opacity: 0; transform: translateX(12px); }

/* ---------- Calisma alani ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

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

/* ---------- Tablo hucreleri ---------- */

.cell-title { font-size: 13px; }
.cell-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.empty-cell { color: var(--muted); text-align: center; padding: 32px; }

.inline-check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: fit-content;
  justify-self: start;
  align-self: center;
  white-space: nowrap;
}

.inline-check input { width: auto; }

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  min-height: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  margin-left: auto;
}

.hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hint.no-margin {
  margin: 6px 0 0;
}

/* ---------- Analiz ---------- */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-grid.compact {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.metric-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.metric-card.success { border-color: rgba(18, 166, 104, 0.28); background: linear-gradient(180deg, var(--success-soft), #ffffff 70%); }
.metric-card.danger { border-color: rgba(220, 38, 38, 0.28); background: linear-gradient(180deg, var(--danger-soft), #ffffff 70%); }
.metric-card.warning { border-color: rgba(215, 139, 0, 0.32); background: linear-gradient(180deg, var(--warning-soft), #ffffff 70%); }

.metric-label,
.metric-detail {
  color: var(--muted);
  font-size: 12px;
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.metric-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
}

.metric-icon svg {
  width: 15px;
  height: 15px;
}

.metric-value {
  margin: 12px 0 8px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #111827;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  margin-bottom: 28px;
}

.panel-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 15px;
}

.funnel-list {
  display: grid;
  gap: 12px;
}

.funnel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.funnel-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-3);
}

.funnel-track div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff6b6b);
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.activity-item {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  padding: 10px 12px;
}

.activity-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.activity-item strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.section-head {
  margin-top: 28px;
  margin-bottom: 12px;
}

.good-text { color: var(--success); }
.bad-text { color: var(--danger); }
.inline-sub { display: inline; margin-left: 6px; }

.detail-page {
  max-width: 1440px;
}

.detail-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.detail-topbar .secondary-button {
  min-width: 84px;
}

.detail-topbar h1 {
  font-size: clamp(22px, 2.2vw, 34px);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 460px);
  gap: 18px;
  align-items: start;
}

.detail-main,
.detail-side {
  display: grid;
  gap: 16px;
}

.detail-page dl {
  padding: 0;
}

.detail-page .panel-block dl {
  padding-top: 4px;
}

.detail-side {
  position: sticky;
  top: 24px;
}

.detail-side .note-input {
  min-height: 132px;
}

.skeleton-line {
  height: 12px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef1f5 0%, #ffffff 42%, #eef1f5 78%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.05s linear infinite;
}

.skeleton-line.wide { width: 92%; }
.skeleton-line.mid { width: 68%; }
.skeleton-line.short { width: 42%; }

.loading-card {
  display: grid;
  gap: 9px;
}

.detail-page.is-loading .panel-block {
  opacity: 0.96;
}

.detail-page.is-loading #detailList dd {
  display: grid;
  align-items: center;
}

@keyframes skeleton-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.followup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-item {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.mini-list .mini-item:nth-child(even),
.duplicate-list .mini-item:nth-child(even) {
  background: #fff7f7;
}

.mini-item:hover {
  border-color: rgba(229, 9, 20, 0.22);
  background: #fff1f2;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.mini-item strong,
.mini-line strong {
  display: block;
  font-size: 13px;
}

.mini-content {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
}

.mini-icon svg {
  width: 15px;
  height: 15px;
}

.mini-item em,
.mini-line span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.mini-item small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.mini-line {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 9px 10px;
  box-shadow: var(--shadow-sm);
}

.duplicate-list {
  display: grid;
  gap: 14px;
}

.duplicate-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-2);
}

.duplicate-key {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.empty-state.compact {
  padding: 12px;
  font-size: 12px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.health-item {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
}

.health-item.ok { border-color: rgba(18, 166, 104, 0.28); }
.health-item.warn { border-color: rgba(215, 139, 0, 0.32); }
.health-item span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.health-item span svg { width: 14px; height: 14px; color: var(--accent); }
.health-item strong { display: block; margin-top: 6px; font-size: 16px; }

.quick-actions,
.note-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 12px;
}

.quick-actions:empty,
.note-templates:empty {
  display: none;
}

.quick-actions .secondary-button,
.note-templates .secondary-button {
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.claim-notice {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(229, 9, 20, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent-soft), #ffffff 76%);
}

.claim-notice-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--accent);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.claim-notice strong {
  display: block;
  color: #111827;
  font-size: 14px;
}

.claim-notice p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.claim-notice .primary-button {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 2px;
}

.note-template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 10px;
}

.template-tab {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  padding: 0 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.template-tab:hover,
.template-tab.active {
  color: var(--accent-dark);
  border-color: rgba(229, 9, 20, 0.22);
  background: var(--accent-soft);
}

.template-tab svg {
  width: 14px;
  height: 14px;
}

/* ---------- Kenar cubugu kullanici alani ---------- */

.sidebar-user {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(229, 9, 20, 0.18);
}

.sidebar-user-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.sidebar-user-name {
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  color: #111827;
  font-weight: 700;
}

.sidebar-user-role {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sidebar-logout {
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: var(--panel-2);
  box-shadow: none;
}

.sidebar-logout:hover:not(:disabled) {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.22);
  background: var(--danger-soft);
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: auto;
    height: auto;
  }

  .sidebar-user {
    position: static;
    margin-top: 18px;
  }

  .content {
    margin-left: 0;
    padding: 20px;
  }

  .form-grid,
  .filter-grid,
  .list-toolbar {
    grid-template-columns: 1fr;
  }

  .list-toolbar:has(.pagination) {
    grid-template-columns: 1fr;
  }

  .list-actions-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .list-actions-toolbar .list-summary {
    margin-left: 0;
  }

  .strategy-head,
  .term-add {
    align-items: stretch;
    flex-direction: column;
  }

  .term-add input {
    max-width: none;
  }

  .table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .table-footer .pagination {
    justify-content: space-between;
  }

  .primary-button,
  .secondary-button,
  .danger-button,
  .icon-button {
    min-width: 0;
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    height: auto;
    min-height: 42px;
    white-space: normal;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .head-actions,
  .view-head {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .analytics-grid,
  .activity-grid,
  .followup-grid,
  .health-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
  }

  .table-shell {
    overflow-x: auto;
  }

  .table-shell table {
    min-width: 720px;
  }
}
