/* TituSMM — ortak bileşenler. Temalar yerleşimi ve yoğunluğu değiştirir; bu dosya ortak dili tanımlar. */
:root {
  --brand: #2563eb; --accent: #7c3aed; --deep: #0f1b3d; --radius-base: 12px; --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f6f8fc; --surface: #ffffff; --surface-2: #eef2f9; --text: #0f172a; --muted: #55617a; --border: #dde3ee;
  --success: #0b7a4b; --success-bg: #e6f6ee; --warning: #8f5200; --warning-bg: #fff4e0;
  --danger: #b42329; --danger-bg: #fdeceb; --info: #1b57c4; --info-bg: #e9f0fd; --attention: #7a3e00; --attention-bg: #ffefd6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
  --space: 1rem; --gap: 1rem; --fs: 1rem; --row: .75rem;
  color-scheme: light;
}
[data-scheme="dark"] {
  --bg: #0a1024; --surface: #111a33; --surface-2: #18223f; --text: #e8ecf6; --muted: #a3adc6; --border: #26314f;
  --success: #4fd18f; --success-bg: #0f2a1d; --warning: #f2b25c; --warning-bg: #2c2110; --danger: #ff8a8f; --danger-bg: #331417;
  --info: #8db4ff; --info-bg: #142139; --attention: #ffb866; --attention-bg: #2f200d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--fs); line-height: 1.5; color: var(--text); background: var(--bg); overflow-wrap: anywhere; }
a { color: var(--brand); text-underline-offset: 2px; }
[data-scheme="dark"] a { color: color-mix(in srgb, var(--brand) 55%, white); }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: .5rem; z-index: 100; background: var(--surface); padding: .5rem 1rem; border-radius: var(--radius); }
.skip-link:focus { left: .5rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Düzen yardımcıları */
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; gap: var(--gap); flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: flex-end; margin-bottom: var(--gap); }
.page-head h1 { margin: 0; }

/* Kart */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: calc(var(--space) * 1.25); box-shadow: var(--shadow); min-width: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin-bottom: .75rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.stat .hint { font-size: .8rem; color: var(--muted); }

/* Butonlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: var(--radius);
  border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; background: var(--surface-2); color: var(--text); line-height: 1.2; }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--brand); color: #fff; }
[data-scheme="dark"] .btn-primary { color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--border); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); color: #fff; }
[data-scheme="dark"] .btn-danger { color: #1a0507; }
.btn-sm { min-height: 36px; padding: .35rem .75rem; font-size: .875rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .65; cursor: progress; }
.btn[aria-busy="true"]::before { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }

/* Formlar */
.form { display: grid; gap: var(--gap); }
.form.cols { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.field { display: grid; gap: .35rem; min-width: 0; }
.field > label, .field > .label { font-weight: 600; font-size: .925rem; }
.field .help { font-size: .825rem; color: var(--muted); }
.field .error { font-size: .85rem; color: var(--danger); font-weight: 600; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: .55rem .75rem; border-radius: calc(var(--radius) * .8); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; }
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; gap: .6rem; align-items: flex-start; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; accent-color: var(--brand); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0 .35rem; }
.choice-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.choice { position: relative; display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; cursor: pointer; background: var(--surface); }
.choice input { position: absolute; opacity: 0; }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: var(--focus); }
.choice:has(input:focus-visible) { outline: 2px solid var(--brand); }

/* Uyarılar ve rozetler */
.alert { border-radius: var(--radius); padding: .8rem 1rem; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.tone-success { background: var(--success-bg); color: var(--success); } .tone-warning { background: var(--warning-bg); color: var(--warning); }
.tone-danger { background: var(--danger-bg); color: var(--danger); } .tone-info { background: var(--info-bg); color: var(--info); }
.tone-attention { background: var(--attention-bg); color: var(--attention); } .tone-neutral { background: var(--surface-2); color: var(--muted); }

/* Tablolar: yatay kaydırma yalnızca tablo bölgesinde; dar ekranda kart görünümü */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: var(--row) .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .btn { white-space: nowrap; }
.table .clip { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { border-bottom: 1px solid var(--border); padding: .6rem .2rem; }
  .table.responsive td { border: 0; padding: .3rem .8rem; display: grid; grid-template-columns: 42% 1fr; gap: .5rem; text-align: left; }
  .table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: .825rem; font-family: var(--font); }
  .table.responsive td > .badge, .table.responsive td > form, .table.responsive td > .btn { justify-self: start; }
  .table.responsive td.num { text-align: left; }
  .table.responsive .clip { max-width: none; white-space: normal; }
  .table-wrap:has(.responsive) { overflow-x: visible; }
}

/* Boş, yükleniyor, hata durumları */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon { font-size: 2rem; display: block; margin-bottom: .5rem; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; min-height: 1em; }
@keyframes shimmer { to { background-position: -200% 0; } }
.state-box { border: 1px dashed var(--border); border-radius: var(--radius); padding: 1rem; }

/* Zaman çizelgesi */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; border-left: 2px solid var(--border); margin-left: .4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
.timeline li:last-child { border-color: transparent; }

/* Sayfalama */
.pager { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; justify-content: center; margin-top: var(--gap); }
.pager a, .pager span { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 0 .6rem; border-radius: var(--radius); border: 1px solid var(--border); text-decoration: none; color: var(--text); background: var(--surface); }
.pager [aria-current] { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Fiyat özeti */
.summary { display: grid; gap: .4rem; background: var(--surface-2); border-radius: var(--radius); padding: 1rem; }
.summary .line { display: flex; justify-content: space-between; gap: 1rem; }
.summary .total { font-size: 1.25rem; font-weight: 800; border-top: 1px solid var(--border); padding-top: .5rem; }
.copy { display: flex; gap: .5rem; align-items: stretch; }
.copy .input { font-family: ui-monospace, Menlo, monospace; min-width: 0; }
.copy .btn { white-space: nowrap; flex-shrink: 0; }
dl.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: .45rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; min-width: 0; }

/* Çekmece (mobil menü) */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; }
.backdrop[hidden] { display: none; }
.prose { line-height: 1.7; }
.prose h2, .prose h3, .prose h4 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose code { background: var(--surface-2); padding: .1rem .35rem; border-radius: 4px; font-size: .9em; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .no-print { display: none !important; } }
