/* =========================================================
   MERGEPURCHASES — Tasarım sistemi (ortak)
   ========================================================= */
:root {
  --ink: #0E1B2C; --ink-2: #1B2B40; --ink-3: #2A3D57;
  --paper: #F4F6F9; --surface: #FFFFFF; --surface-2: #F9FAFC;
  --steel: #5B6B80; --steel-2: #8593A6; --line: #DCE2EA; --line-2: #E9EDF2;
  --blue: #1747D1; --blue-600: #1239AE; --blue-50: #EDF2FE; --blue-100: #D8E3FC;
  --amber: #E39B25; --amber-50: #FDF4E3; --amber-700: #9A630C;
  --green: #12805C; --green-50: #E6F4EE; --red: #C2362B; --red-50: #FBEBE9;
  --orange: #C2620F; --orange-50: #FCEFE3; --violet: #5B3FC4; --violet-50: #EFEBFB;

  --font-head: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-12: .75rem; --fs-13: .8125rem; --fs-14: .875rem; --fs-15: .9375rem; --fs-16: 1rem; --fs-18: 1.125rem;
  --fs-20: 1.25rem; --fs-24: 1.5rem; --fs-30: 1.875rem; --fs-36: 2.25rem; --fs-48: 3rem;

  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --shadow-1: 0 1px 2px rgba(14, 27, 44, .06), 0 1px 1px rgba(14, 27, 44, .04);
  --shadow-2: 0 8px 24px -8px rgba(14, 27, 44, .18);
  --shadow-3: 0 24px 60px -20px rgba(14, 27, 44, .35);
  --container: 1200px; --gutter: clamp(16px, 4vw, 32px);
  --focus: 0 0 0 3px rgba(23, 71, 209, .35);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:lang(ar) { --font-head: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif; --font-body: "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); font-size: var(--fs-16); line-height: 1.55; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0; letter-spacing: -.01em; color: var(--ink); }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { letter-spacing: 0; line-height: 1.4; }
p { margin: 0; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-600); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.num, table td, .tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; 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; inset-inline-start: 12px; top: -48px; z-index: 1000; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); }
.skip-link:focus { top: 12px; color: #fff; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .92em; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }

/* Butonlar */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border: 1px solid var(--btn-bd); border-radius: var(--r-md); background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: var(--fs-15); line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { --btn-bd: var(--steel-2); color: var(--btn-fg); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { --btn-bg: var(--blue); --btn-fg: #fff; --btn-bd: var(--blue); }
.btn-primary:hover { --btn-bg: var(--blue-600); --btn-bd: var(--blue-600); }
.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink); }
.btn-dark:hover { --btn-bg: var(--ink-2); --btn-bd: var(--ink-2); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn-ghost:hover { --btn-bg: var(--line-2); --btn-bd: transparent; }
.btn-danger { --btn-bg: var(--surface); --btn-fg: var(--red); --btn-bd: #F0C9C4; }
.btn-danger:hover { --btn-bg: var(--red-50); --btn-bd: var(--red); }
.btn-success { --btn-bg: var(--green); --btn-fg: #fff; --btn-bd: var(--green); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: var(--fs-14); border-radius: var(--r-sm); }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: var(--fs-16); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) transparent transparent; animation: spin .7s linear infinite; }
.btn:not(.btn-primary):not(.btn-dark):not(.btn-success).is-loading::after { border-color: var(--ink) var(--ink) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; color: var(--steel); position: relative; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field .row-between > label, .label { font-size: var(--fs-14); font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--red); margin-inline-start: 2px; }
.hint { font-size: var(--fs-13); color: var(--steel); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-inline-end: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6B80' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
[dir="rtl"] .select { background-position: left 10px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--steel-2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.input[readonly] { background: var(--surface-2); color: var(--steel); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--red); }
.field-error { font-size: var(--fs-13); color: var(--red); }
.field-error:empty { display: none; }
.input-group { display: flex; }
.input-group > .input, .input-group > .select { border-radius: 0; }
.input-group > :first-child { border-start-start-radius: var(--r-md); border-end-start-radius: var(--r-md); }
.input-group > :last-child { border-start-end-radius: var(--r-md); border-end-end-radius: var(--r-md); }
.input-group > :not(:first-child) { margin-inline-start: -1px; }
.input-addon { display: grid; place-items: center; padding: 0 12px; min-width: 48px; background: var(--surface-2); border: 1px solid var(--line); color: var(--steel); font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-14); color: var(--ink-2); line-height: 1.45; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); flex: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: var(--fs-14); font-weight: 500; color: var(--ink-2); }
.chip input:checked + span { border-color: var(--blue); background: var(--blue-50); color: var(--blue-600); font-weight: 600; }
.chip input:focus-visible + span { box-shadow: var(--focus); }

/* Rozetler */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: var(--fs-12); font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge-blue { background: var(--blue-50); color: var(--blue-600); }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-amber { background: var(--amber-50); color: var(--amber-700); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-orange { background: var(--orange-50); color: var(--orange); }
.badge-violet { background: var(--violet-50); color: var(--violet); }
.badge-gray { background: var(--line-2); color: var(--steel); }
.seal { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-12); font-weight: 700; color: var(--amber-700); background: var(--amber-50); border: 1px solid #F3D49C; padding: 2px 8px 2px 6px; border-radius: 999px; white-space: nowrap; }
.seal svg { width: 14px; height: 14px; }
.flag { width: 22px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(14,27,44,.12); flex: none; display: inline-block; vertical-align: -2px; }
.flag-code { display: inline-grid; place-items: center; font-size: 9px; font-weight: 700; letter-spacing: .02em; color: var(--steel); background: var(--line-2); line-height: 1; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }

/* Tablo */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.table th { text-align: start; font-weight: 600; color: var(--steel); font-size: var(--fs-13); padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFD; }
.table .right { text-align: end; }
.cell-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-main strong { font-weight: 600; color: var(--ink); }
.cell-main small { color: var(--steel); font-size: var(--fs-13); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 900; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; background: rgba(14, 27, 44, .55); backdrop-filter: blur(3px); overflow-y: auto; }
.modal.open { display: flex; }
.modal-dialog { width: 100%; max-width: 640px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); animation: modalIn .22s var(--ease); }
.modal-dialog.lg { max-width: 880px; }
.modal-dialog.sm { max-width: 460px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal-head h2 { font-size: var(--fs-20); }
.modal-head p { color: var(--steel); font-size: var(--fs-14); margin-top: 4px; }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.prose { color: var(--ink-2); font-size: var(--fs-15); line-height: 1.7; max-width: 72ch; }
.prose h3 { font-size: var(--fs-16); margin: 22px 0 8px; }
.prose p + p { margin-top: 10px; }
.prose ul { padding-inline-start: 20px; margin: 8px 0; }
.prose li { margin: 4px 0; }
.draft-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--amber-50); color: var(--amber-700); font-size: var(--fs-13); margin-bottom: 16px; }
.draft-note svg { width: 18px; height: 18px; flex: none; }

/* Toast */
.toast-stack { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--ink); color: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-3); font-size: var(--fs-14); animation: toastIn .25s var(--ease); }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: #6EE7B7; }
.toast.error .dot { background: #FCA5A5; }
.toast.warn .dot { background: #FCD34D; }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 20px; color: var(--steel); }
.empty strong { color: var(--ink); font-size: var(--fs-16); }
.empty svg { width: 40px; height: 40px; color: var(--steel-2); margin-bottom: 6px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: 0; background: none; padding: 12px 14px; font-weight: 600; font-size: var(--fs-14); color: var(--steel); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }

.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 950; max-width: 760px; margin: 0 auto; display: none; gap: 16px; align-items: center; flex-wrap: wrap; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); font-size: var(--fs-14); color: var(--ink-2); }
.cookie-bar.show { display: flex; }
.cookie-bar p { flex: 1 1 300px; }
.cookie-bar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Metin içindeki ikonlar */
p > svg, .hint > svg, small > svg, .hint svg { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-inline-end: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
