/* SBT Commerce — yönetim paneli. Mağaza temalarından bağımsız, sade ve yoğun bir iş arayüzü. */
:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #1b2130; --muted: #667085; --line: #e3e6eb; --line-2: #d0d5dd;
  --side: #1f2a44; --side-ink: #c9d1e3; --side-active: #2f3d5f;
  --accent: #2d5bd7; --accent-ink: #fff; --accent-soft: #e8eefc;
  --green: #117a4b; --green-soft: #e3f4ea; --amber: #a15c00; --amber-soft: #fdf1dc; --red: #b42318; --red-soft: #fdecea;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.ad { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
code, .ad-mono { font-family: var(--mono); font-size: .92em; }
small, .small { font-size: 12.5px; }
.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; }
.ad-skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.ad-skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Yerleşim */
.ad-side { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--side); color: var(--side-ink); overflow-y: auto; z-index: 30; padding-bottom: 24px; }
.ad-side__brand a { display: block; padding: 18px 18px 14px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.ad-side__brand strong { display: block; font-size: 15px; }
.ad-side__brand span { font-size: 12px; color: var(--side-ink); opacity: .8; }
.ad-side__group { margin: 18px 18px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.ad-side nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 18px; color: var(--side-ink); text-decoration: none; border-left: 3px solid transparent; }
.ad-side nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.ad-side nav a[aria-current="page"] { background: var(--side-active); color: #fff; border-left-color: #7fa2ff; }
.ad-badge { background: #e5484d; color: #fff; font-size: 11px; line-height: 18px; min-width: 20px; text-align: center; padding: 0 6px; border-radius: 9px; font-weight: 600; }
.ad-main-wrap { margin-left: 236px; min-height: 100vh; }
.ad-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 54px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ad-top__store { font-weight: 500; }
.ad-top__user { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.ad-top__user form { margin: 0; }
.ad-burger { display: none; background: none; border: 1px solid var(--line-2); border-radius: 8px; width: 38px; height: 36px; font-size: 18px; cursor: pointer; color: var(--ink); }
.ad-main { padding: 24px; max-width: 1360px; }
.ad-main:focus { outline: none; }
.ad-demo { background: #fff8e6; color: #6b4a00; border-bottom: 1px solid #f3dfae; padding: 9px 24px; font-size: 13px; }
.ad-demo--box { border: 1px solid #f3dfae; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; line-height: 1.7; }

/* Başlık, kartlar */
.ad-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ad-head .ad-muted { margin: 4px 0 0; }
.ad-crumb { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.ad-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); min-width: 0; }
.ad-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ad-card__head h2 { margin: 0; }
.ad-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ad-cols--wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.ad-cols > * { min-width: 0; }
.ad-grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; border: 0; padding: 0; margin: 0; min-width: 0; }
.ad-grid-2--tight { grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ad-card .ad-grid-2 { grid-template-columns: 1fr 1fr; }
.ad-mt { margin-top: 20px; }
.ad-muted { color: var(--muted); }
.ad-red { color: var(--red); }
.ad-amber { color: var(--amber); }
.ad-right { text-align: right; }
.ad-center { text-align: center; }
.ad-wrap { word-break: break-word; max-width: 360px; }
.ad-empty { color: var(--muted); padding: 18px 0; margin: 0; text-align: center; }
.ad-note { margin: 12px 0; padding: 10px 14px; background: var(--bg); border-left: 3px solid var(--line-2); border-radius: 0 6px 6px 0; }
.ad-address { font-style: normal; line-height: 1.6; }

/* Düğmeler */
.ad-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: 500 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.ad-btn:hover { background: #f8f9fb; text-decoration: none; }
.ad-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ad-btn--primary:hover { background: #2349b8; }
.ad-btn--danger { color: var(--red); border-color: #f1b4ae; }
.ad-btn--danger:hover { background: var(--red-soft); }
.ad-btn--block { width: 100%; }
.ad-btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.ad-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.ad-link:hover { text-decoration: underline; }
.ad-danger { color: var(--red); }
.ad-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ad-inline form { margin: 0; }
.ad-actions, .ad-sticky-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.ad-sticky-actions { position: sticky; bottom: 0; z-index: 10; background: rgba(244, 245, 247, .94); backdrop-filter: blur(4px); padding: 12px 0; border-top: 1px solid var(--line); }

/* Formlar */
input, select, textarea { font: inherit; color: var(--ink); }
.ad-field { margin-bottom: 14px; }
.ad-label, .ad-field > label, .ad-ship label, .ad-login label { display: block; font-weight: 550; margin-bottom: 5px; font-size: 13.5px; }
.ad-field input:not([type=checkbox]):not([type=radio]):not([type=file]), .ad-field select, .ad-field textarea,
.ad-filters input, .ad-filters select, .ad-table input:not([type=checkbox]), .ad-table select, .ad-ship input, .ad-ship select, .ad-images input:not([type=checkbox]), .ad-login input {
  width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
.ad-field textarea { resize: vertical; line-height: 1.5; }
.ad-field input:focus, .ad-field select:focus, .ad-field textarea:focus, .ad-table input:focus, .ad-table select:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--red) !important; }
.ad-help { font-size: 12.5px; color: var(--muted); margin: 5px 0 0; }
.ad-err { font-size: 13px; color: var(--red); margin: 5px 0 0; font-weight: 500; }
.ad-check { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; cursor: pointer; font-weight: 400; }
.ad-check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.ad-checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; }
.ad-checklist--scroll { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; grid-template-columns: 1fr; }
.ad-fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.ad-fieldset legend { font-weight: 550; font-size: 13.5px; margin-bottom: 6px; padding: 0; }
fieldset[disabled] { opacity: .85; }
.ad-readonly { padding: 8px 10px; background: var(--bg); border-radius: 8px; }
.ad-qty { max-width: 90px; }
.ad-money { max-width: 120px; }
.ad-thumb-lg { display: block; width: 160px; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--line); }
.ad-inline-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ad-flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.ad-flash--ok { background: var(--green-soft); color: var(--green); }
.ad-flash--error { background: var(--red-soft); color: var(--red); }

/* Filtre ve sekmeler */
.ad-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.ad-filters input, .ad-filters select { width: auto; min-width: 150px; }
.ad-filters input[name="q"] { min-width: 260px; flex: 1 1 260px; max-width: 420px; }
.ad-head .ad-filters { margin: 0; }
.ad-tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.ad-tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; margin-bottom: -1px; }
.ad-tabs a b { font-weight: 500; background: var(--bg); border-radius: 9px; padding: 0 6px; font-size: 12px; margin-left: 2px; }
.ad-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 550; }

/* Tablolar */
.ad-table-wrap { overflow-x: auto; padding: 0; }
.ad-table-wrap > .ad-table { margin: 0; }
.ad-table { width: 100%; border-collapse: collapse; }
.ad-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ad-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ad-table tbody tr:last-child td { border-bottom: 0; }
.ad-table-wrap .ad-table tbody tr:hover { background: #fafbfc; }
.ad-card:not(.ad-table-wrap) .ad-table th:first-child, .ad-card:not(.ad-table-wrap) .ad-table td:first-child { padding-left: 0; }
.ad-card:not(.ad-table-wrap) .ad-table th:last-child, .ad-card:not(.ad-table-wrap) .ad-table td:last-child { padding-right: 0; }
.ad-table th.ad-right, .ad-table th.ad-center { text-align: inherit; }
.ad-table th.ad-right { text-align: right; }
.ad-table th.ad-center { text-align: center; }
.ad-thumbcell { width: 56px; padding-right: 0 !important; }
.ad-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--bg); display: block; }
.ad-variants td { padding: 6px 6px; vertical-align: middle; }
.ad-variants input, .ad-variants select { min-width: 90px; }
.ad-matrix td, .ad-matrix th { vertical-align: middle; }
.ad-matrix input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Durum rozetleri */
.ad-pill, .ad-status { display: inline-block; font-size: 12px; font-weight: 550; line-height: 20px; padding: 0 8px; border-radius: 10px; background: var(--bg); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.ad-pill--green { background: var(--green-soft); color: var(--green); }
.ad-pill--amber { background: var(--amber-soft); color: var(--amber); }
.ad-pill--red { background: var(--red-soft); color: var(--red); }
.ad-status--processing, .ad-status--r-approved, .ad-status--r-received { background: var(--accent-soft); color: var(--accent); }
.ad-status--awaiting_payment, .ad-status--pending_payment, .ad-status--r-requested { background: var(--amber-soft); color: var(--amber); }
.ad-status--shipped { background: #efe8fd; color: #5b33b6; }
.ad-status--delivered, .ad-status--completed, .ad-status--r-refunded { background: var(--green-soft); color: var(--green); }
.ad-status--cancelled, .ad-status--payment_failed, .ad-status--refunded, .ad-status--partially_refunded, .ad-status--r-rejected { background: var(--red-soft); color: var(--red); }
h1 .ad-status { font-size: 13px; margin-left: 6px; }

/* Gösterge paneli */
.ad-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.ad-kpi { margin: 0; }
.ad-kpi p { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.ad-kpi strong { display: block; font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.ad-kpi span { color: var(--muted); font-size: 12.5px; }
.ad-todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ad-todo__item { display: flex; flex-direction: column; margin: 0; padding: 14px 16px; color: var(--muted); text-decoration: none; }
.ad-todo__item:hover { text-decoration: none; border-color: var(--line-2); }
.ad-todo__item strong { font-size: 22px; color: var(--ink); }
.ad-todo__item.is-hot { border-color: #f3c98b; background: #fffaf0; }
.ad-todo__item.is-hot strong { color: var(--amber); }
.ad-list { list-style: none; margin: 0; padding: 0; }
.ad-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ad-list li:last-child { border-bottom: 0; }
.ad-list li > :last-child { text-align: right; flex: none; }
.ad-chart { width: 100%; height: auto; display: block; }
.ad-chart rect { fill: var(--accent); opacity: .85; }
.ad-chart rect:hover { opacity: 1; }
.ad-chart text { font-size: 11px; fill: var(--muted); }
.ad-bars { list-style: none; margin: 0; padding: 0; }
.ad-bars li { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; padding: 5px 0; }
.ad-bars i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--w), var(--bg) var(--w)); }
.ad-bars span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sipariş */
.ad-sum { margin: 12px 0 0; }
.ad-sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.ad-sum dt { color: var(--muted); }
.ad-sum dd { margin: 0; font-variant-numeric: tabular-nums; }
.ad-sum__total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px !important; font-weight: 650; font-size: 15px; }
.ad-sum__total dt { color: var(--ink); }
.ad-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.ad-timeline li { position: relative; padding: 0 0 12px 10px; }
.ad-timeline li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); }
.ad-actions-card .ad-inline { margin-bottom: 12px; }
.ad-ship { display: grid; grid-template-columns: auto minmax(140px, 200px) auto minmax(160px, 240px) auto; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.ad-ship label { margin: 0; }
.ad-table td, .ad-sum dd, .ad-kpi strong { font-variant-numeric: tabular-nums; }

/* Ürün */
.ad-images { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.ad-images li { display: grid; gap: 6px; }
.ad-images img { width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.ad-images input:not([type=checkbox]) { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.ad-product section.ad-card > .ad-btn { margin-top: 8px; }
.ad-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 16px; align-items: start; }

/* Sayfalama */
.ad-pages { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 16px; }
.ad-pages a, .ad-pages span { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); text-decoration: none; }
.ad-pages [aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Giriş */
body.ad-login { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; background: linear-gradient(160deg, #1f2a44 0%, #2c3a5c 100%); }
.ad-login__box { width: 100%; max-width: 400px; background: var(--panel); border-radius: 14px; padding: 28px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.ad-login__store { margin: 0 0 2px; color: var(--muted); font-size: 13px; }
.ad-login h1 { margin-bottom: 18px; }
.ad-login form { display: grid; gap: 4px; margin-bottom: 16px; }
.ad-login input { margin-bottom: 10px; }
.ad-login .ad-btn { margin-top: 6px; min-height: 42px; }

/* Duyarlı */
@media (max-width: 1100px) {
  .ad-cols, .ad-cols--wide, .ad-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .ad-ship { grid-template-columns: 1fr 1fr; }
  .ad-ship label { grid-column: span 1; }
}
@media (max-width: 860px) {
  .ad-side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.side-open .ad-side { transform: none; }
  .ad-main-wrap { margin-left: 0; }
  .ad-burger { display: inline-block; }
  .ad-top { padding: 0 16px; }
  .ad-top__user span { display: none; }
  .ad-main { padding: 16px; }
  .ad-demo { padding: 8px 16px; }
  .ad-kpis { grid-template-columns: 1fr; gap: 10px; }
  .ad-kpi strong { font-size: 20px; }
  .ad-filters input[name="q"] { min-width: 0; flex-basis: 100%; max-width: none; }
  .ad-filters input, .ad-filters select { min-width: 0; flex: 1 1 140px; }
  .ad-card .ad-grid-2, .ad-grid-2--tight { grid-template-columns: 1fr; }
  .ad-settings { grid-template-columns: minmax(0, 1fr); }
  .ad-ship { grid-template-columns: 1fr; }
  .ad-bars li { grid-template-columns: 90px 1fr auto; }
  .ad-table th, .ad-table td { padding: 8px; }
  .ad-card:not(.ad-table-wrap) { overflow-x: auto; }
  .ad-table th { white-space: normal; }
  h1 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { .ad-side { transition: none; } }
@media print { .ad-side, .ad-top, .ad-demo, .ad-actions-card, .ad-sticky-actions { display: none; } .ad-main-wrap { margin: 0; } }
.ad-table td:first-child > a { white-space: nowrap; }
.ad-forbidden { max-width: 560px; margin: 40px auto; text-align: center; padding: 32px; } .ad-forbidden h1 { margin-bottom: 10px; }
.ad-card:has(.ad-table) { overflow-x: auto; }
