/* Adıgüzel Künefe – ortak tasarım sistemi */
:root {
  --espresso-950: #1c110c;
  --espresso-900: #2b1a12;
  --espresso-800: #3a2419;
  --espresso-700: #4e3224;
  --espresso-600: #6a4634;
  --cream-50: #fffdf8;
  --cream-100: #fbf6ec;
  --cream-200: #f4ead8;
  --cream-300: #e9dbc1;
  --gold-300: #e6cf9f;
  --gold-400: #d6b77a;
  --gold-500: #c09a57;
  --gold-600: #9c7a3c;
  --pistachio-100: #e9f1df;
  --pistachio-400: #93b46a;
  --pistachio-500: #6f9447;
  --pistachio-700: #4a6a2c;

  --bg: #faf6ee;
  --surface: #ffffff;
  --surface-2: var(--cream-100);
  --line: #ece2d1;
  --line-strong: #dccdb3;
  --ink: #24170f;
  --ink-2: #5b4a3f;
  --ink-3: #8c7b6e;
  --accent: var(--gold-500);
  --primary: var(--espresso-900);

  --ok: #3f7d3a; --ok-bg: #e8f3e3;
  --warn: #a8670f; --warn-bg: #fbefd9;
  --danger: #b4382f; --danger-bg: #fbe7e4;
  --info: #2c6a94; --info-bg: #e3eff7;

  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  --series-brand: #a8692e;

  --radius-sm: 10px; --radius: 14px; --radius-lg: 20px; --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(43, 26, 18, .06), 0 1px 1px rgba(43, 26, 18, .04);
  --shadow: 0 6px 24px -8px rgba(43, 26, 18, .18), 0 2px 6px rgba(43, 26, 18, .05);
  --shadow-lg: 0 24px 60px -16px rgba(28, 17, 12, .35);
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-ui); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }

/* ---- butonlar ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 12px;
  border: 1px solid transparent; background: var(--surface); font-weight: 650; font-size: 14px; letter-spacing: .01em; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, border-color .2s, opacity .2s; text-decoration: none; user-select: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--espresso-900); color: var(--cream-50); box-shadow: 0 6px 16px -8px rgba(43, 26, 18, .7); }
.btn-primary:hover { background: var(--espresso-800); }
.btn-gold { background: linear-gradient(180deg, #d4b274, #b8904a); color: #2b1a12; box-shadow: 0 6px 16px -8px rgba(156, 122, 60, .8); }
.btn-gold:hover { filter: brightness(1.04); }
.btn-ok { background: var(--pistachio-500); color: #fff; }
.btn-ok:hover { background: var(--pistachio-700); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); }
.btn-soft { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-soft:hover { border-color: var(--line-strong); background: var(--cream-200); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.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-soft.loading::after, .btn-ghost.loading::after { border-color: var(--ink-2) var(--ink-2) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- form ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  outline: none; transition: border-color .2s, box-shadow .2s; font-size: 15px; }
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold-500); box-shadow: 0 0 0 4px rgba(192, 154, 87, .18); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .icon { position: absolute; left: 13px; color: var(--ink-3); pointer-events: none; }
.input-group > .input { padding-left: 40px; }
.input-group .suffix { position: absolute; right: 14px; color: var(--ink-3); font-weight: 600; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease); }
.switch input:checked + .track { background: var(--pistachio-500); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(111, 148, 71, .25); }

.check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .2s, background .2s; }
.check:hover { border-color: var(--line-strong); }
.check input { width: 20px; height: 20px; accent-color: var(--espresso-900); flex: none; margin: 0; }
.check:has(input:checked) { border-color: var(--gold-500); background: #fffaf0; }

/* ---- rozet / çip ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gold { background: #f7ecd6; color: var(--gold-600); }
.badge-dark { background: var(--espresso-900); color: var(--cream-100); }

/* ---- kart ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }

/* ---- modal / sheet ---- */
.overlay { position: fixed; inset: 0; background: rgba(28, 17, 12, .48); backdrop-filter: blur(3px); z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity .25s var(--ease); }
.overlay.open { opacity: 1; }
.modal { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100dvh - 40px);
  display: flex; flex-direction: column; transform: translateY(16px) scale(.98); transition: transform .3s var(--ease); overflow: hidden; }
.overlay.open .modal { transform: none; }
.modal.lg { width: min(820px, 100%); }
.modal.xl { width: min(1080px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 14px; }
.modal-head h3 { font-size: 19px; font-weight: 750; flex: 1; }
.modal-body { padding: 4px 22px 20px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--cream-50); flex-wrap: wrap; }
@media (max-width: 640px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.lg, .modal.xl { width: 100%; border-radius: 24px 24px 0 0; max-height: 94dvh; transform: translateY(100%); }
  .modal-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
}

/* ---- bildirim (toast) ---- */
.toasts { position: fixed; z-index: 2000; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; width: min(380px, calc(100vw - 32px)); }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--espresso-900); color: var(--cream-50);
  box-shadow: var(--shadow-lg); animation: toastIn .4s var(--ease); font-size: 14px; font-weight: 550; }
.toast .icon { margin-top: 2px; width: 20px; height: 20px; }
.toast.ok .icon { color: var(--pistachio-400); }
.toast.error { background: #5a1f1a; }
.toast.error .icon { color: #ffb4a8; }
.toast.alert { background: linear-gradient(135deg, var(--espresso-900), #4a2f1d); border: 1px solid rgba(214, 183, 122, .35); }
.toast.alert .icon { color: var(--gold-400); }
.toast b { display: block; font-weight: 750; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@media (max-width: 640px) { .toasts { left: 16px; right: 16px; width: auto; } }

/* ---- iskelet / boş durum ---- */
.skel { background: linear-gradient(90deg, var(--cream-200) 0%, var(--cream-100) 40%, var(--cream-200) 80%); background-size: 300% 100%; animation: shimmer 1.4s infinite linear; border-radius: 10px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 20px; color: var(--ink-3); }
.empty .empty-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--cream-200); color: var(--gold-600); margin-bottom: 4px; }
.empty .empty-icon .icon { width: 28px; height: 28px; }
.empty h4 { color: var(--ink); font-size: 17px; font-weight: 750; }
.empty p { max-width: 360px; font-size: 14px; }

/* ---- tablo ---- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--cream-50); }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #fffbf3; }
.table .right { text-align: right; }
.table td.num, .table td.right { white-space: nowrap; }

.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--cream-200); border-radius: 12px; overflow-x: auto; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 650; font-size: 13px; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button .count { margin-left: 6px; font-size: 11px; background: var(--espresso-900); color: #fff; padding: 1px 7px; border-radius: 99px; }

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