/* DüştüBu Panel — tasarım sistemi */
:root {
  --brand: #5a26d6; --brand-hover: #4c1fc0; --brand-soft: #efe9ff; --lime: #dcff55; --ink: #140b33;
  --bg: #f6f5f9; --surface: #ffffff; --surface-2: #f9f8fc; --line: #e8e5ef; --line-strong: #d9d4e6;
  --text: #17122b; --muted: #6e6984; --faint: #a19cb5;
  --ok: #138a4d; --ok-soft: #e4f6ec; --warn: #b35c00; --warn-soft: #fff2e0; --danger: #d0364a; --danger-soft: #fdeaec;
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --shadow: 0 1px 2px rgba(20, 11, 51, .05), 0 4px 16px rgba(20, 11, 51, .05);
  --shadow-lg: 0 24px 60px rgba(20, 11, 51, .18);
  --ease: cubic-bezier(.2, .8, .2, 1);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #8b63ff; --brand-hover: #9b78ff; --brand-soft: #241a45; --bg: #0d0b14; --surface: #16131f; --surface-2: #1b1826;
    --line: #2a2538; --line-strong: #363047; --text: #efedf6; --muted: #a29db6; --faint: #6d6882;
    --ok: #46c985; --ok-soft: #14301f; --warn: #f0a24a; --warn-soft: #33240f; --danger: #ff6b7d; --danger-soft: #3a1820;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
a { color: var(--brand); text-decoration: none; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
[hidden] { display: none !important; }

/* ---------- yerleşim ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--surface); }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 900; font-style: italic; font-size: 18px; }
.logo img { width: 30px; height: 30px; border-radius: 8px; }
.logo b { color: var(--brand); }
.logo small { font-style: normal; font-weight: 600; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 7px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--muted); font-weight: 550; transition: background .15s, color .15s; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--brand-soft); color: var(--brand); }
.nav-item .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--danger); color: #fff; border-radius: 99px; padding: 0 6px; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r); border: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; }
.me .who { min-width: 0; }
.me .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: 12px; color: var(--muted); }
main { min-width: 0; padding: 26px 32px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.view { animation: view-in .28s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- bileşenler ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: var(--r-sm); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
input, select, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 8px 11px; width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
label.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
label.field > span.hint { font-weight: 450; color: var(--faint); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 550; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 99px; transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.toggle-row div b { display: block; font-size: 13.5px; }
.toggle-row div span { font-size: 12.5px; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.plain::before { display: none; }
.discount { display: inline-block; background: var(--lime); color: var(--ink); font-weight: 800; border-radius: 99px; padding: 1px 8px; font-size: 12.5px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { position: relative; flex: 1 1 240px; max-width: 360px; }
.toolbar .search svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; width: 16px; color: var(--faint); }
.toolbar .search input { padding-left: 34px; }
.toolbar select { width: auto; min-width: 140px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* tablo */
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.clickable { cursor: pointer; }
tbody tr:last-child td { border-bottom: 0; }
td .title { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 420px; }
td .sub { font-size: 12px; color: var(--muted); }
.thumb { width: 44px; height: 44px; border-radius: 10px; background: #fff; border: 1px solid var(--line); object-fit: contain; padding: 3px; flex: none; }
.cell-product { display: flex; align-items: center; gap: 12px; }
.price b { font-variant-numeric: tabular-nums; }
.price s { color: var(--faint); font-size: 12px; margin-left: 6px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: var(--faint); margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.bulkbar { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); z-index: 30; animation: rise .25s var(--ease); }
.bulkbar .btn { background: transparent; border-color: rgba(255,255,255,.2); color: #fff; }
.bulkbar .btn:hover { background: rgba(255,255,255,.1); }
.bulkbar .btn.danger { color: #ff8a98; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* gösterge */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi strong { display: block; font-size: 28px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi.accent { background: var(--lime); border-color: transparent; }
.kpi.accent span, .kpi.accent strong { color: var(--ink); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.list { list-style: none; margin: 0; padding: 6px 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list li .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.list li .m { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; }

/* kampanya kartları */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.camp { padding: 16px 18px; display: grid; gap: 8px; cursor: pointer; border-left: 4px solid var(--brand); transition: transform .15s var(--ease), box-shadow .15s; }
.camp:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.camp.bank { border-left-color: #2f7bf5; }
.camp.code { border-left-color: #f08c1a; }
.camp .kind { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; justify-content: space-between; }
.camp h3 { font-size: 15px; }
.camp .code-chip { justify-self: start; font-family: ui-monospace, Menlo, monospace; font-weight: 700; padding: 3px 10px; border: 1.5px dashed #f08c1a; border-radius: 8px; color: #b8650c; }

/* çekmece */
.scrim { position: fixed; inset: 0; background: rgba(13, 9, 30, .38); backdrop-filter: blur(2px); z-index: 40; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 10px; right: 10px; bottom: 10px; width: min(620px, calc(100vw - 20px)); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 41; display: flex; flex-direction: column; animation: slide .32s var(--ease); }
.drawer.closing { animation: slide-out .2s ease-in forwards; }
.scrim.closing { animation: fade .2s reverse forwards; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes slide-out { to { transform: translateX(40px); opacity: 0; } }
.drawer header, .drawer footer { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
.drawer header { border-bottom: 1px solid var(--line); justify-content: space-between; }
.drawer footer { border-top: 1px solid var(--line); }
.drawer .body { overflow: auto; padding: 18px 20px 24px; display: grid; gap: 16px; align-content: start; }
.drawer .spacer { flex: 1; }
.section-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-top: 6px; }
.fetch-row { display: flex; gap: 8px; }
.fetch-row input { flex: 1; }
.notice { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.notice.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery button { width: 72px; height: 72px; border-radius: 12px; border: 2px solid var(--line); background: #fff; padding: 4px; cursor: pointer; transition: border-color .15s; }
.gallery button.main { border-color: var(--brand); }
.gallery img { width: 100%; height: 100%; object-fit: contain; }
.preview-big { height: 220px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.preview-big img { max-width: 100%; max-height: 100%; object-fit: contain; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.calc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.calc strong { font-size: 20px; }
.spark { width: 100%; height: 70px; }
.err { color: var(--danger); font-weight: 600; font-size: 13px; }

/* modal */
.modal { position: fixed; left: 50%; top: 50%; translate: -50% -50%; width: min(440px, calc(100vw - 32px)); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 41; animation: pop .25s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.modal .body { padding: 20px; display: grid; gap: 14px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }

/* bildirim baloncuğu */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { min-width: 240px; max-width: 380px; padding: 11px 14px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-weight: 550; animation: rise .25s var(--ease); }
.toast.error { background: var(--danger); }

/* iskelet */
.skeleton { background: var(--line); border-radius: 8px; animation: pulse 1.1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .45; } to { opacity: 1; } }

/* giriş */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(400px, 100%); padding: 32px 28px; display: grid; gap: 16px; animation: pop .35s var(--ease); }
.auth-card .logo { justify-content: center; padding: 0 0 6px; font-size: 22px; }
.auth-card .logo img { width: 40px; height: 40px; border-radius: 11px; }
.auth-card h1 { text-align: center; font-size: 20px; }
.auth-card p.lead { text-align: center; margin: -8px 0 4px; color: var(--muted); }
.auth-card .btn { height: 42px; }
.strength { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s var(--ease), background .25s; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .logo { width: 100%; padding-bottom: 6px; }
  .side .me, .nav-sep { display: none; }
  main { padding: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
