/* ==========================================================================
   KiyakEmlak SaaS — Bileşen kütüphanesi
   ========================================================================== */

/* --------------------------------------------------------------------------
   Düğmeler
   -------------------------------------------------------------------------- */
.btn {
  --btn-h: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--btn-h); padding: 0 15px;
  font-size: 13.5px; font-weight: 560; line-height: 1; white-space: nowrap;
  border-radius: var(--r-md); border: 1px solid transparent;
  cursor: pointer; user-select: none; position: relative;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast),
              box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn-primary   { background: var(--brand-600); color: #fff; box-shadow: var(--sh-xs); }
.btn-primary:hover   { background: var(--brand-700); box-shadow: var(--sh-brand); color: #fff; }
.btn-secondary { background: var(--bg-surface); color: var(--text-body); border-color: var(--border); box-shadow: var(--sh-xs); }
.btn-secondary:hover { background: var(--bg-surface-2); border-color: var(--border-strong); color: var(--text-strong); }
.btn-ghost     { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-surface-3); color: var(--text-strong); }
.btn-soft      { background: var(--brand-50); color: var(--brand-700); }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-800); }
.btn-success   { background: var(--success-600); color: #fff; }
.btn-success:hover { background: var(--success-700); color: #fff; }
.btn-danger    { background: var(--danger-600); color: #fff; }
.btn-danger:hover  { background: var(--danger-700); color: #fff; }
.btn-danger-soft { background: var(--danger-50); color: var(--danger-600); }
.btn-danger-soft:hover { background: var(--danger-100); color: var(--danger-700); }
.btn-warning   { background: var(--warning-500); color: #fff; }
.btn-warning:hover { background: var(--warning-600); color: #fff; }
.btn-dark      { background: var(--gray-900); color: #fff; }
.btn-dark:hover { background: var(--gray-800); color: #fff; }
.btn-outline-primary { background: transparent; color: var(--brand-600); border-color: var(--brand-300); }
.btn-outline-primary:hover { background: var(--brand-50); border-color: var(--brand-500); }

.btn-xs { --btn-h: 26px; padding: 0 8px; font-size: 11.5px; border-radius: var(--r-sm); gap: 5px; }
.btn-xs svg { width: 13px; height: 13px; }
.btn-sm { --btn-h: 32px; padding: 0 11px; font-size: 12.5px; gap: 6px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { --btn-h: 46px; padding: 0 22px; font-size: 15px; border-radius: var(--r-lg); }
.btn-lg svg { width: 18px; height: 18px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 0; width: var(--btn-h); }
.btn-round { border-radius: var(--r-full); }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r-md) 0 0 var(--r-md); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
.btn-group .btn.is-active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); z-index: 1; }

/* Segment kontrolü */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg-surface-3); border-radius: var(--r-md);
}
.segmented button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; font-size: 12.5px; font-weight: 550;
  color: var(--text-muted); border-radius: var(--r-sm);
  transition: all var(--t-fast);
}
.segmented button svg { width: 14px; height: 14px; }
.segmented button:hover { color: var(--text-strong); }
.segmented button.is-active { background: var(--bg-surface); color: var(--text-strong); box-shadow: var(--sh-xs); }

/* --------------------------------------------------------------------------
   Kart
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.card-flush { box-shadow: none; }
.card-hover { transition: box-shadow var(--t-base), transform var(--t-base), border-color var(--t-base); }
.card-hover:hover { box-shadow: var(--sh-lg); transform: translateY(-2px); border-color: var(--border-strong); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);
}
.card-head h3, .card-head h4 { margin: 0; }
.card-title { font-size: 15px; font-weight: 620; color: var(--text-strong); display: flex; align-items: center; gap: 9px; }
.card-title svg { width: 17px; height: 17px; color: var(--text-muted); }
.card-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body-tight { padding: 14px 16px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border-subtle); background: var(--bg-surface-2); }
.card-actions { display: flex; align-items: center; gap: 8px; }

/* İstatistik kartı */
.stat {
  position: relative; padding: 18px 20px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.stat:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stat-label { font-size: 12.5px; font-weight: 540; color: var(--text-muted); }
.stat-value { font-size: 27px; font-weight: 680; letter-spacing: -.022em; color: var(--text-strong); margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-value small { font-size: 15px; font-weight: 560; color: var(--text-muted); margin-left: 3px; }
.stat-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.stat-icon {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-md); background: var(--brand-50); color: var(--brand-600);
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.is-success { background: var(--success-50); color: var(--success-600); }
.stat-icon.is-warning { background: var(--warning-50); color: var(--warning-600); }
.stat-icon.is-danger  { background: var(--danger-50);  color: var(--danger-600); }
.stat-icon.is-info    { background: var(--info-50);    color: var(--info-600); }
.stat-icon.is-purple  { background: var(--purple-50);  color: var(--purple-600); }
.stat-icon.is-teal    { background: var(--teal-50);    color: var(--teal-600); }
.stat-icon.is-pink    { background: var(--pink-50);    color: var(--pink-600); }
.stat-spark { position: absolute; right: 0; bottom: 0; left: 0; height: 42px; opacity: .5; pointer-events: none; }

.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; }
.trend svg { width: 13px; height: 13px; }
.trend.up   { color: var(--success-600); }
.trend.down { color: var(--danger-600); }
.trend.flat { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Rozet & etiket
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; font-size: 11.5px; font-weight: 580; line-height: 1.5;
  border-radius: var(--r-full); white-space: nowrap;
  background: var(--bg-surface-3); color: var(--text-body);
}
.badge svg { width: 12px; height: 12px; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-brand   { background: var(--brand-50);   color: var(--brand-700); }
.badge-success { background: var(--success-50); color: var(--success-700); }
.badge-danger  { background: var(--danger-50);  color: var(--danger-700); }
.badge-warning { background: var(--warning-50); color: var(--warning-700); }
.badge-info    { background: var(--info-50);    color: var(--info-700); }
.badge-purple  { background: var(--purple-50);  color: var(--purple-600); }
.badge-teal    { background: var(--teal-50);    color: var(--teal-600); }
.badge-pink    { background: var(--pink-50);    color: var(--pink-600); }
.badge-gray    { background: var(--bg-surface-3); color: var(--text-muted); }
.badge-solid   { background: var(--brand-600); color: #fff; }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); }
.badge-sq { border-radius: var(--r-sm); }
.badge-lg { padding: 5px 12px; font-size: 12.5px; }

html[data-theme="dark"] .badge-brand   { background: rgba(99,102,241,.16); color: var(--brand-300); }
html[data-theme="dark"] .badge-success { background: rgba(16,185,129,.15); color: #6ee7b7; }
html[data-theme="dark"] .badge-danger  { background: rgba(239,68,68,.15);  color: #fca5a5; }
html[data-theme="dark"] .badge-warning { background: rgba(245,158,11,.15); color: #fcd34d; }
html[data-theme="dark"] .badge-info    { background: rgba(59,130,246,.15); color: #93c5fd; }
html[data-theme="dark"] .badge-purple  { background: rgba(168,85,247,.15); color: #d8b4fe; }
html[data-theme="dark"] .badge-teal    { background: rgba(20,184,166,.15); color: #5eead4; }
html[data-theme="dark"] .badge-pink    { background: rgba(236,72,153,.15); color: #f9a8d4; }
html[data-theme="dark"] .stat-icon.is-success { background: rgba(16,185,129,.14); }
html[data-theme="dark"] .stat-icon.is-warning { background: rgba(245,158,11,.14); }
html[data-theme="dark"] .stat-icon.is-danger  { background: rgba(239,68,68,.14); }
html[data-theme="dark"] .stat-icon.is-info    { background: rgba(59,130,246,.14); }
html[data-theme="dark"] .stat-icon.is-purple  { background: rgba(168,85,247,.14); }
html[data-theme="dark"] .stat-icon.is-teal    { background: rgba(20,184,166,.14); }
html[data-theme="dark"] .stat-icon.is-pink    { background: rgba(236,72,153,.14); }
html[data-theme="dark"] .stat-icon { background: rgba(99,102,241,.14); }

/* Sayaç balonu */
.pill-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  font-size: 11px; font-weight: 640; border-radius: var(--r-full);
  background: var(--bg-surface-3); color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.pill-count.is-brand { background: var(--brand-600); color: #fff; }
.pill-count.is-danger { background: var(--danger-500); color: #fff; }

/* --------------------------------------------------------------------------
   Avatar
   -------------------------------------------------------------------------- */
.avatar {
  --av: 38px;
  position: relative; width: var(--av); height: var(--av); flex: none;
  border-radius: var(--r-full); overflow: hidden;
  display: grid; place-items: center;
  background: var(--brand-100); color: var(--brand-700);
  font-size: calc(var(--av) * .38); font-weight: 640; letter-spacing: -.01em;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { --av: 24px; } .avatar-sm { --av: 30px; } .avatar-md { --av: 38px; }
.avatar-lg { --av: 48px; } .avatar-xl { --av: 64px; } .avatar-2xl { --av: 88px; }
.avatar-sq { border-radius: var(--r-md); }
.avatar-ring { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--brand-200); }
.avatar-status::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 32%; height: 32%; border-radius: 50%;
  border: 2px solid var(--bg-surface); background: var(--gray-400);
}
.avatar-status.is-online::after  { background: var(--success-500); }
.avatar-status.is-away::after    { background: var(--warning-500); }
.avatar-status.is-busy::after    { background: var(--danger-500); }

.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -10px; box-shadow: 0 0 0 2px var(--bg-surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .more {
  background: var(--bg-surface-3); color: var(--text-muted); font-size: 11px;
}

/* Kullanıcı satırı */
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-cell .name { font-size: 13.5px; font-weight: 570; color: var(--text-strong); }
.user-cell .meta { font-size: 12px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label {
  font-size: 12.5px; font-weight: 570; color: var(--text-body);
  display: flex; align-items: center; gap: 5px;
}
.field-label .req { color: var(--danger-500); }
.field-hint { font-size: 11.5px; color: var(--text-subtle); }
.field-error { font-size: 11.5px; color: var(--danger-600); display: flex; align-items: center; gap: 4px; }
.field-error svg { width: 13px; height: 13px; }

.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 13px;
  font-size: 13.5px; color: var(--text-strong);
  background-color: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-md); transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  appearance: none;
}
.textarea { height: auto; min-height: 96px; padding: 10px 13px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3.5px var(--ring);
}
/* Kısayol yerine background-color: aksi halde .select'in ok ikonu (background-image)
   ve konumu sıfırlanıp tekrarlanıyor. */
.input:disabled, .select:disabled, .textarea:disabled { background-color: var(--bg-surface-3); color: var(--text-subtle); cursor: not-allowed; }
.input.is-error, .select.is-error, .textarea.is-error { border-color: var(--danger-500); }
.input.is-error:focus { box-shadow: 0 0 0 3.5px rgba(239,68,68,.25); }
.input-sm { height: 34px; font-size: 12.5px; padding: 0 10px; }
.input-lg { height: 46px; font-size: 15px; padding: 0 16px; }

.select {
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
html[data-theme="dark"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 38px; }
.input-group .input.has-suffix { padding-right: 38px; }
.input-icon {
  position: absolute; left: 13px; width: 16px; height: 16px;
  color: var(--text-subtle); pointer-events: none;
}
.input-icon.right { left: auto; right: 13px; }
.input-suffix {
  position: absolute; right: 12px; font-size: 12.5px; color: var(--text-muted);
  font-weight: 540; pointer-events: none;
}
.input-addon {
  display: inline-flex; align-items: center; height: 40px; padding: 0 12px;
  background: var(--bg-surface-3); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted); white-space: nowrap;
}
.input-addon:first-child { border-radius: var(--r-md) 0 0 var(--r-md); border-right: 0; }
.input-addon:last-child  { border-radius: 0 var(--r-md) var(--r-md) 0; border-left: 0; }
.input-group.joined .input { border-radius: 0; }
.input-group.joined .input:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group.joined .input:last-child  { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* Onay kutusu & radyo */
.check, .radio {
  display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer;
  font-size: 13.5px; color: var(--text-body); user-select: none;
}
.check input, .radio input {
  appearance: none; width: 17px; height: 17px; flex: none; margin-top: 1px;
  border: 1.6px solid var(--border-strong); background: var(--bg-surface);
  transition: all var(--t-fast); cursor: pointer; position: relative;
}
.check input { border-radius: 5px; }
.radio input { border-radius: 50%; }
.check input:hover, .radio input:hover { border-color: var(--brand-500); }
.check input:checked, .radio input:checked { background: var(--brand-600); border-color: var(--brand-600); }
.check input:checked::after {
  content: ""; position: absolute; left: 5px; top: 1.5px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check input:indeterminate { background: var(--brand-600); border-color: var(--brand-600); }
.check input:indeterminate::after {
  content: ""; position: absolute; left: 3px; top: 6.5px; width: 9px; height: 2px; background: #fff; border: 0; transform: none;
}
.radio input:checked::after {
  content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: #fff;
}
.check input:focus-visible, .radio input:focus-visible { box-shadow: 0 0 0 3.5px var(--ring); outline: none; }

/* Anahtar */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; position: absolute; opacity: 0; }
.switch .track {
  width: 38px; height: 21px; flex: none; border-radius: var(--r-full);
  background: var(--border-strong); position: relative; transition: background var(--t-base);
}
.switch .track::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: var(--sh-sm);
  transition: transform var(--t-base);
}
.switch input:checked + .track { background: var(--brand-600); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3.5px var(--ring); }
.switch input:disabled + .track { opacity: .5; }
.switch-sm .track { width: 32px; height: 18px; }
.switch-sm .track::after { width: 13px; height: 13px; }
.switch-sm input:checked + .track::after { transform: translateX(14px); }

/* Seçim kartı (radyo/checkbox kart) */
.choice-card {
  position: relative; display: flex; gap: 12px; padding: 14px;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  background: var(--bg-surface); cursor: pointer; transition: all var(--t-fast);
}
.choice-card:hover { border-color: var(--brand-300); background: var(--brand-50); }
.choice-card input { position: absolute; opacity: 0; }
.choice-card:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 3px var(--ring); }
html[data-theme="dark"] .choice-card:hover,
html[data-theme="dark"] .choice-card:has(input:checked) { background: rgba(99,102,241,.1); }
.choice-card .ci {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-md); background: var(--bg-surface-3); color: var(--text-muted);
}
.choice-card:has(input:checked) .ci { background: var(--brand-600); color: #fff; }
.choice-card .ci svg { width: 19px; height: 19px; }
.choice-card .ct { font-size: 13.5px; font-weight: 580; color: var(--text-strong); }
.choice-card .cd { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Etiket girişi */
.taginput {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  min-height: 40px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-surface);
}
.taginput:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 3.5px var(--ring); }
.taginput input { flex: 1; min-width: 90px; border: 0; outline: none; background: transparent; font-size: 13px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px 3px 9px;
  background: var(--brand-50); color: var(--brand-700);
  border-radius: var(--r-sm); font-size: 12px; font-weight: 540;
}
.tag-chip button { display: grid; place-items: center; width: 15px; height: 15px; border-radius: 3px; color: currentColor; opacity: .6; }
.tag-chip button:hover { opacity: 1; background: rgba(0,0,0,.08); }
.tag-chip svg { width: 11px; height: 11px; }

/* Dosya yükleme alanı */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 32px 20px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg);
  background: var(--bg-surface-2); transition: all var(--t-fast);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand-500); background: var(--brand-50); }
html[data-theme="dark"] .dropzone:hover, html[data-theme="dark"] .dropzone.is-over { background: rgba(99,102,241,.08); }
.dropzone .dz-icon {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--r-full);
  background: var(--brand-50); color: var(--brand-600);
}
.dropzone .dz-icon svg { width: 22px; height: 22px; }

/* Aralık kaydırıcı */
.range { width: 100%; appearance: none; height: 4px; border-radius: var(--r-full); background: var(--border); }
.range::-webkit-slider-thumb {
  appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-600); border: 2.5px solid #fff; box-shadow: var(--sh-sm); cursor: pointer;
}
.range::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-600); border: 2.5px solid #fff; box-shadow: var(--sh-sm); cursor: pointer;
}

/* Genişleyen ek seçenekler */
details.field > summary { display: block; list-style: none; cursor: pointer; padding: 4px 0; }
details.field > summary::-webkit-details-marker { display: none; }
details.field > summary > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
details.field > summary svg { width: 15px; height: 15px; flex: none; transition: transform var(--t-base); }
details.field[open] > summary svg { transform: rotate(45deg); }

/* Form bölümü */
.form-section { display: grid; grid-template-columns: 260px 1fr; gap: 32px; padding: 26px 0; border-bottom: 1px solid var(--border-subtle); }
.form-section:last-child { border-bottom: 0; }
.form-section-info h4 { font-size: 14.5px; margin-bottom: 4px; }
.form-section-info p { font-size: 12.5px; color: var(--text-muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px 18px; }
@media (max-width: 1023px) { .form-section { grid-template-columns: 1fr; gap: 16px; } }
@media (max-width: 639px) { .form-grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Tablo
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; font-size: 13.5px; }
.table thead th {
  position: sticky; top: 0; z-index: 2;
  padding: 11px 16px; text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 620; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-subtle); background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border);
}
.table thead th.sortable { cursor: pointer; user-select: none; }
.table thead th.sortable:hover { color: var(--text-body); }
.table thead th .sort-ico { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-left: 4px; opacity: .45; }
.table thead th.is-sorted .sort-ico { opacity: 1; color: var(--brand-600); }
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; color: var(--text-body); }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--bg-surface-2); }
.table tbody tr.is-selected { background: var(--brand-50); }
html[data-theme="dark"] .table tbody tr.is-selected { background: rgba(99,102,241,.1); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }
.table-compact tbody td { padding: 9px 12px; }
.table-compact thead th { padding: 8px 12px; }
.table-striped tbody tr:nth-child(even) { background: var(--bg-surface-2); }
.table-bordered td, .table-bordered th { border-right: 1px solid var(--border-subtle); }
.table-bordered td:last-child, .table-bordered th:last-child { border-right: 0; }
.table .col-check { width: 44px; padding-right: 0; }
.table .col-actions { width: 90px; }

/* Sayfalama */
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination button, .pagination a {
  min-width: 34px; height: 34px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 550; color: var(--text-muted);
  border-radius: var(--r-sm); border: 1px solid transparent; transition: all var(--t-fast);
}
.pagination button:hover:not(:disabled), .pagination a:hover { background: var(--bg-surface-3); color: var(--text-strong); }
.pagination .is-active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.pagination .is-active:hover { background: var(--brand-700); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination svg { width: 15px; height: 15px; }
.pagination .gap { color: var(--text-subtle); pointer-events: none; }

/* --------------------------------------------------------------------------
   Sekme
   -------------------------------------------------------------------------- */
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs::-webkit-scrollbar { height: 0; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 14px; font-size: 13.5px; font-weight: 550; white-space: nowrap;
  color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--text-strong); }
.tab.is-active { color: var(--brand-600); border-bottom-color: var(--brand-600); }
.tab .pill-count { margin-left: 2px; }
.tabs-pill { border: 0; gap: 6px; }
.tabs-pill .tab { border: 0; border-radius: var(--r-full); padding: 7px 14px; margin: 0; }
.tabs-pill .tab.is-active { background: var(--brand-600); color: #fff; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fadeIn var(--t-base); }

/* --------------------------------------------------------------------------
   Açılır menü
   -------------------------------------------------------------------------- */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: var(--z-dropdown);
  min-width: 200px; padding: 6px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  max-height: 70vh; overflow-y: auto;
}
.dropdown-menu.left { right: auto; left: 0; }
.dropdown.is-open > .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; font-size: 13.5px; color: var(--text-body); text-align: left;
  border-radius: var(--r-sm); transition: background var(--t-fast), color var(--t-fast);
}
.dropdown-item:hover { background: var(--bg-surface-3); color: var(--text-strong); }
.dropdown-item svg { width: 16px; height: 16px; color: var(--text-subtle); flex: none; }
.dropdown-item:hover svg { color: var(--text-body); }
.dropdown-item.is-danger { color: var(--danger-600); }
.dropdown-item.is-danger svg { color: var(--danger-500); }
.dropdown-item.is-danger:hover { background: var(--danger-50); color: var(--danger-700); }
.dropdown-item .kbd { margin-left: auto; }
.dropdown-sep { height: 1px; background: var(--border-subtle); margin: 5px 0; }
.dropdown-head { padding: 8px 10px 6px; font-size: 11px; font-weight: 620; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); }

.kbd {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted);
  background: var(--bg-surface-3); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: var(--r-xs);
}

/* --------------------------------------------------------------------------
   Modal / çekmece
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: var(--bg-overlay); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity var(--t-base), visibility var(--t-base);
}
.overlay.is-open { opacity: 1; visibility: visible; }

.modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity var(--t-base), visibility var(--t-base);
  overflow-y: auto;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal-box {
  width: 100%; max-width: 540px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--bg-surface); border-radius: var(--r-xl); box-shadow: var(--sh-xl);
  transform: translateY(14px) scale(.97); transition: transform var(--t-base);
}
.modal.is-open .modal-box { transform: none; }
.modal-sm .modal-box { max-width: 420px; }
.modal-lg .modal-box { max-width: 780px; }
.modal-xl .modal-box { max-width: 1080px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border-subtle); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 16px 22px; border-top: 1px solid var(--border-subtle); background: var(--bg-surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.modal-close {
  width: 32px; height: 32px; display: grid; place-items: center; flex: none;
  border-radius: var(--r-sm); color: var(--text-subtle); transition: all var(--t-fast);
}
.modal-close:hover { background: var(--bg-surface-3); color: var(--text-strong); }
.modal-close svg { width: 18px; height: 18px; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-modal);
  width: min(460px, 100vw); display: flex; flex-direction: column;
  background: var(--bg-surface); box-shadow: var(--sh-xl);
  transform: translateX(100%); transition: transform var(--t-slow);
}
.drawer.is-open { transform: none; }
.drawer-lg { width: min(680px, 100vw); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--border); background: var(--bg-surface-2); display: flex; gap: 9px; justify-content: flex-end; }

/* --------------------------------------------------------------------------
   Bildirim (toast)
   -------------------------------------------------------------------------- */
.toast-host {
  position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 11px;
  min-width: 300px; max-width: 400px; padding: 13px 15px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-left: 3px solid var(--brand-600);
  border-radius: var(--r-md); box-shadow: var(--sh-lg);
  pointer-events: auto; animation: slideInRight var(--t-slow) both;
}
.toast.is-hide { animation: fadeIn var(--t-base) reverse both; }
.toast .ti { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--brand-600); }
.toast.is-success { border-left-color: var(--success-500); } .toast.is-success .ti { color: var(--success-600); }
.toast.is-danger  { border-left-color: var(--danger-500); }  .toast.is-danger .ti  { color: var(--danger-600); }
.toast.is-warning { border-left-color: var(--warning-500); } .toast.is-warning .ti { color: var(--warning-600); }
.toast-title { font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
.toast-msg { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* Uyarı kutusu */
.alert {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 15px; border-radius: var(--r-md);
  background: var(--info-50); color: var(--info-700);
  border: 1px solid transparent; font-size: 13px;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-title { font-weight: 620; margin-bottom: 2px; }
.alert-success { background: var(--success-50); color: var(--success-700); }
.alert-warning { background: var(--warning-50); color: var(--warning-700); }
.alert-danger  { background: var(--danger-50);  color: var(--danger-700); }
.alert-brand   { background: var(--brand-50);   color: var(--brand-700); }
html[data-theme="dark"] .alert         { background: rgba(59,130,246,.12); color: #93c5fd; }
html[data-theme="dark"] .alert-success { background: rgba(16,185,129,.12); color: #6ee7b7; }
html[data-theme="dark"] .alert-warning { background: rgba(245,158,11,.12); color: #fcd34d; }
html[data-theme="dark"] .alert-danger  { background: rgba(239,68,68,.12);  color: #fca5a5; }
html[data-theme="dark"] .alert-brand   { background: rgba(99,102,241,.12); color: var(--brand-300); }

/* --------------------------------------------------------------------------
   İlerleme
   -------------------------------------------------------------------------- */
.progress { height: 7px; border-radius: var(--r-full); background: var(--bg-surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand-600); transition: width var(--t-slow); animation: progressBar 700ms ease-out; }
.progress.is-success > span { background: var(--success-500); }
.progress.is-warning > span { background: var(--warning-500); }
.progress.is-danger  > span { background: var(--danger-500); }
.progress-sm { height: 5px; } .progress-lg { height: 10px; }
.progress-stack { display: flex; height: 7px; border-radius: var(--r-full); overflow: hidden; background: var(--bg-surface-3); }
.progress-stack > span { display: block; height: 100%; }

.ring-progress { position: relative; display: inline-grid; place-items: center; }
.ring-progress svg { transform: rotate(-90deg); }
.ring-progress .rp-track { stroke: var(--bg-surface-3); }
.ring-progress .rp-bar { stroke: var(--brand-600); stroke-linecap: round; transition: stroke-dashoffset var(--t-slow); }
.ring-progress .rp-label { position: absolute; font-size: 13px; font-weight: 660; color: var(--text-strong); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--brand-600);
  animation: spin .7s linear infinite;
}
.spinner-lg { width: 30px; height: 30px; border-width: 3px; }

/* --------------------------------------------------------------------------
   Boş durum
   -------------------------------------------------------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 52px 24px; text-align: center;
}
.empty-icon {
  width: 62px; height: 62px; display: grid; place-items: center; border-radius: var(--r-full);
  background: var(--bg-surface-3); color: var(--text-subtle);
}
.empty-icon svg { width: 28px; height: 28px; }
.empty h4 { font-size: 15px; }
.empty p { font-size: 13px; color: var(--text-muted); max-width: 360px; }

/* --------------------------------------------------------------------------
   Zaman çizelgesi
   -------------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -30px; top: 1px;
  width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: var(--bg-surface);
  border: 2px solid var(--border); color: var(--text-muted);
}
.tl-dot svg { width: 12px; height: 12px; }
.tl-dot.is-brand   { border-color: var(--brand-500);   background: var(--brand-50);   color: var(--brand-600); }
.tl-dot.is-success { border-color: var(--success-500); background: var(--success-50); color: var(--success-600); }
.tl-dot.is-danger  { border-color: var(--danger-500);  background: var(--danger-50);  color: var(--danger-600); }
.tl-dot.is-warning { border-color: var(--warning-500); background: var(--warning-50); color: var(--warning-600); }
.tl-title { font-size: 13.5px; font-weight: 570; color: var(--text-strong); }
.tl-meta { font-size: 12px; color: var(--text-subtle); margin-top: 1px; }
.tl-body { font-size: 13px; color: var(--text-muted); margin-top: 5px; }

/* --------------------------------------------------------------------------
   Adım göstergesi
   -------------------------------------------------------------------------- */
.stepper { display: flex; align-items: flex-start; gap: 0; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; text-align: center; }
.step::before, .step::after {
  content: ""; position: absolute; top: 15px; height: 2px; background: var(--border);
}
.step::before { left: 0; right: 50%; margin-right: 20px; }
.step::after  { left: 50%; right: 0; margin-left: 20px; }
.step:first-child::before, .step:last-child::after { display: none; }
.step-num {
  width: 31px; height: 31px; display: grid; place-items: center; flex: none;
  border-radius: 50%; background: var(--bg-surface); border: 2px solid var(--border);
  font-size: 12.5px; font-weight: 640; color: var(--text-subtle); z-index: 1;
  transition: all var(--t-base);
}
.step-num svg { width: 15px; height: 15px; }
.step-label { font-size: 12.5px; font-weight: 550; color: var(--text-muted); }
.step.is-active .step-num { background: var(--brand-600); border-color: var(--brand-600); color: #fff; box-shadow: 0 0 0 4px var(--ring); }
.step.is-active .step-label { color: var(--brand-700); font-weight: 620; }
.step.is-done .step-num { background: var(--success-500); border-color: var(--success-500); color: #fff; }
.step.is-done::before, .step.is-done::after { background: var(--success-500); }
.step.is-active::before { background: var(--success-500); }

/* --------------------------------------------------------------------------
   Kanban
   -------------------------------------------------------------------------- */
.kanban { display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; padding-bottom: 10px; }
.kb-col {
  flex: 0 0 300px; width: 300px; display: flex; flex-direction: column;
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); max-height: calc(100vh - 240px);
}
.kb-col-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.kb-col-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kb-col-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.kb-card {
  padding: 12px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-xs); cursor: grab;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}
.kb-card:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.kb-card.is-dragging { opacity: .45; }
.kb-col.is-over .kb-col-body { background: var(--brand-50); border-radius: var(--r-md); }
html[data-theme="dark"] .kb-col.is-over .kb-col-body { background: rgba(99,102,241,.08); }

/* --------------------------------------------------------------------------
   Grafik yardımcıları (saf SVG)
   -------------------------------------------------------------------------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--border-subtle); stroke-width: 1; }
.chart .axis-text { fill: var(--text-subtle); font-size: 10.5px; font-family: var(--font-sans); }
.chart .area { opacity: .16; }
.chart .line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart .bar { transition: opacity var(--t-fast); }
.chart .bar:hover { opacity: .78; }
.chart .dot { stroke: var(--bg-surface); stroke-width: 2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.chart-tip {
  position: absolute; z-index: var(--z-tooltip); pointer-events: none;
  padding: 7px 10px; font-size: 12px; white-space: nowrap;
  background: var(--gray-900); color: #fff; border-radius: var(--r-sm); box-shadow: var(--sh-md);
  opacity: 0; transition: opacity var(--t-fast); transform: translate(-50%, -130%);
}
.chart-tip.is-on { opacity: 1; }

/* --------------------------------------------------------------------------
   İpucu (tooltip)
   -------------------------------------------------------------------------- */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%;
  transform: translateX(-50%) translateY(3px); z-index: var(--z-tooltip);
  padding: 5px 9px; font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: var(--gray-900); color: #fff; border-radius: var(--r-sm);
  opacity: 0; visibility: hidden; transition: all var(--t-fast); pointer-events: none;
}
[data-tip]:hover::after { opacity: 1; visibility: visible; transform: translateX(-50%); }
[data-tip-pos="right"]::after { bottom: auto; top: 50%; left: calc(100% + 7px); transform: translateY(-50%) translateX(-3px); }
[data-tip-pos="right"]:hover::after { transform: translateY(-50%); }
[data-tip-pos="bottom"]::after { bottom: auto; top: calc(100% + 7px); transform: translateX(-50%) translateY(-3px); }
[data-tip-pos="bottom"]:hover::after { transform: translateX(-50%); }

/* --------------------------------------------------------------------------
   Diğer
   -------------------------------------------------------------------------- */
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-subtle); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb .sep { color: var(--text-subtle); display: inline-flex; }
.breadcrumb .sep svg { width: 13px; height: 13px; }
.breadcrumb .current { color: var(--text-strong); font-weight: 560; }

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  border-radius: var(--r-md); color: var(--text-muted); position: relative;
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--bg-surface-3); color: var(--text-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.is-active { background: var(--brand-50); color: var(--brand-600); }
.icon-btn .dot-badge {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger-500); border: 1.5px solid var(--bg-surface);
}
.icon-btn .num-badge {
  position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center; font-size: 10px; font-weight: 660;
  border-radius: var(--r-full); background: var(--danger-500); color: #fff;
  border: 1.5px solid var(--bg-surface);
}

.list-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle); transition: background var(--t-fast);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--bg-surface-2); }

.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 13px; align-items: baseline; }
.meta-list dt { color: var(--text-muted); white-space: nowrap; }
.meta-list dd { color: var(--text-strong); font-weight: 540; margin: 0; }

.tile-link {
  display: flex; flex-direction: column; gap: 10px; padding: 18px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  transition: all var(--t-base); color: inherit;
}
.tile-link:hover { border-color: var(--brand-400); box-shadow: var(--sh-md); transform: translateY(-2px); color: inherit; }

.color-swatch { width: 24px; height: 24px; border-radius: var(--r-sm); border: 1px solid var(--border); cursor: pointer; }
.color-swatch.is-active { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--brand-500); }

.scroll-x { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.scroll-x > * { scroll-snap-align: start; }

.ratio-16-9 { position: relative; padding-top: 56.25%; overflow: hidden; }
.ratio-4-3  { position: relative; padding-top: 75%; overflow: hidden; }
.ratio-1-1  { position: relative; padding-top: 100%; overflow: hidden; }
.ratio-16-9 > *, .ratio-4-3 > *, .ratio-1-1 > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
