/* Admin pages: quotes, returns, tickets, catalogue lists, content, groups, notifications, audit — shared list, form and detail pieces */

/* ---------------------------------------------------------------- list cards */
.ap-list .ap-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 18px; }
.ap-tools .om-fsearch { flex: 1 1 260px; max-width: 380px; }
.ap-tools .select, .ap-tools .input:not([type="search"]) {
  width: auto; flex: 0 1 auto; min-width: 150px; max-width: 230px; height: 40px; border-radius: 11px; border-color: var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
}
.ap-tools .select:hover, .ap-tools .input:not([type="search"]):hover { border-color: var(--line-strong); }
.ap-tools .select.is-set { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--ink); }
.ap-tools .input[type="date"] { min-width: 0; width: 150px; }
.ap-tools .segmented { flex: none; }
.ap-tools .segmented a, .ap-tools .segmented label { height: 30px; font-size: 13px; }
.ap-tools .spacer { flex: 1 1 0; }
.ap-tools-end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ap-dates { display: inline-flex; align-items: center; gap: 6px; }
.ap-list .table-wrap, .ap-list > .empty, .ap-list > .filters-applied, .ap-list > .ap-body { border-top: 1px solid var(--line-2); }
.ap-list > .filters-applied { border-bottom: 0; }
.ap-list > .table-wrap.ap-flush { border-top: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
.ap-list > .card-head + .table-wrap { border-top: 0; }
.ap-list > .filters-applied + .table-wrap { border-top-color: var(--line-2); }
.ap-list .pager { padding: 14px 18px; }
.ap-list .pager .link-btn, .ap-list .pager > a { font-weight: 650; }

.ap-table th, .ap-table td { padding-left: 12px; padding-right: 12px; }
.ap-table th:first-child, .ap-table td:first-child { padding-left: 18px; }
.ap-table th:last-child, .ap-table td:last-child { padding-right: 16px; }
.ap-table td { padding-top: 13px; padding-bottom: 13px; }
.ap-table .cell-title { font-weight: 650; }
.ap-table tr.is-attention td:first-child { box-shadow: inset 3px 0 0 var(--tape); }
.ap-table tr.is-dim td { color: var(--muted); }
.ap-table tr.is-dim .cell-title, .ap-table tr.is-dim .ap-name b { color: var(--ink-2); }
.ap-nowrap { white-space: nowrap; }
.ap-num-strong { font-weight: 700; color: var(--ink); }
.ap-of { color: var(--faint); font-weight: 600; }
.ap-kdv { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-left: 3px; }

/* entity cell: tone tile + title + sub line */
.ap-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ap-name > span:last-child, .ap-name > div:last-child { min-width: 0; }
.ap-name b, .ap-name .cell-title { display: block; font-weight: 650; color: var(--ink); line-height: 1.3; }
.ap-name a.cell-title:hover { color: var(--brand-text); }
.ap-name small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 550; margin-top: 1px; }
.ap-name .ti-md { border-radius: 12px; }
.ap-thumb { width: 42px; height: 42px; border-radius: 12px; overflow: hidden; flex: none; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--faint); }
.ap-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.ap-name .ap-thumb { width: 36px; height: 36px; border-radius: 11px; }
.ap-clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; }
.ap-who b { max-width: 220px; }

.ap-act { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.ap-act > a, .ap-act > button, .ap-act button[data-dropdown], .ap-act form > button:not(.menu-item) {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); border: 0; background: none; cursor: pointer; padding: 0;
}
.ap-act > a:hover, .ap-act > button:hover:not([disabled]), .ap-act button[data-dropdown]:hover, .ap-act .is-open button[data-dropdown], .ap-act form > button:not(.menu-item):hover:not([disabled]) { background: var(--surface-3); color: var(--ink); }
.ap-act button[disabled] { opacity: 0.3; cursor: default; }
.ap-act .icon { width: 17px; height: 17px; }
.ap-act form { margin: 0; display: inline-flex; }
.ap-act .menu { text-align: left; }
.ap-act .menu form { display: block; }

.ap-meter { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; min-width: 96px; }
.ap-meter .meter { width: 96px; height: 6px; }

/* status pills above lists reuse the order tabs; one extra dot tone */
.om-tab-dot.is-gray { background: var(--faint); }

/* empty state inside a list card */
.ap-list > .empty { padding: 48px 24px; }
.ap-list > .empty:first-child { border-top: 0; }

/* switch shown as the green "Yayında" toggle used on the product list */
.ap-pub { position: relative; display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.ap-pub input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ap-pub-track { position: relative; flex: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); transition: background 0.2s; }
.ap-pub-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 22, 48, 0.25); transition: transform 0.2s var(--ease); }
.ap-pub input:checked + .ap-pub-track { background: var(--success-bright); }
.ap-pub input:checked + .ap-pub-track::after { transform: translateX(18px); }
.ap-pub input:focus-visible + .ap-pub-track { box-shadow: var(--ring); }

@media (max-width: 720px) {
  .ap-list .ap-tools { padding: 14px 14px 12px; gap: 8px; }
  .ap-tools .om-fsearch { flex-basis: 100%; max-width: none; }
  .ap-tools .select, .ap-tools .input:not([type="search"]) { flex: 1 1 calc(50% - 4px); max-width: none; min-width: 0; }
  .ap-tools .ap-dates { flex: 1 1 100%; }
  .ap-tools .ap-dates .input { flex: 1; width: auto; }
  .ap-tools .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ap-tools .segmented::-webkit-scrollbar { display: none; }
  .ap-tools .spacer { display: none; }
  .ap-tools-end { margin-left: 0; }
  .ap-list .pager { padding: 12px 16px; flex-wrap: wrap; }
  .table-stack.ap-table tr { padding: 14px 16px; }
  .table-stack.ap-table td.primary { padding-bottom: 8px !important; }
  .table-stack.ap-table td.actions { width: auto; justify-content: flex-end; padding-top: 4px !important; }
  .table-stack.ap-table tr.is-attention { box-shadow: inset 3px 0 0 var(--tape); }
  .table-stack.ap-table tr.is-attention td:first-child { box-shadow: none; }
  .table-stack.ap-table td.actions:empty { display: none; }
  .ap-who b { max-width: 190px; }
  .ap-meter { align-items: flex-end; }
  .ap-clamp { max-width: none; }
}

/* ---------------------------------------------------------------- forms: two-column sections on one card */
.ap-form-wrap { max-width: 1080px; margin: 0 auto; }
.ap-form-card .card-body { padding: 8px 24px; }
.ap-form-card .form-section-head h3 { display: flex; align-items: center; gap: 8px; }
.ap-form-foot {
  position: sticky; bottom: 12px; z-index: 15; display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding: 10px 12px 10px 18px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); box-shadow: var(--shadow-md);
}
.ap-form-foot > .hint, .ap-form-foot > .ap-foot-start { margin-right: auto; }
.ap-foot-start { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ap-switch-field { justify-content: center; }
.ap-switch-sub { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.ap-current-img { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.ap-current-img .ap-thumb { width: 52px; height: 52px; }
.ap-danger { border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); }
.ap-danger .card-head h2 { color: var(--danger); }
.ap-danger-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ap-danger-row .field { flex: 1 1 240px; }
@media (max-width: 1024px) {
  .ap-form-foot { bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); }
  .ap-form-foot > .hint { display: none; }
  .ap-form-card .card-body { padding: 4px 16px; }
}
@media (max-width: 520px) {
  .ap-form-foot { padding: 8px; }
  .ap-form-foot .btn-primary { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------- detail pages */
.ap-detail-sub a { color: var(--ink); font-weight: 650; }
.ap-detail-sub a:hover { color: var(--brand-text); }
.od-steps.ap-steps-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.od-step.is-bad .od-step-dot { background: var(--danger-bright); color: #fff; }
.od-step.is-bad::after { background: var(--line-2); }
.od-steps.is-closed .od-step.is-bad { opacity: 1; }
.ap-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; overflow: hidden; }
.ap-fact { padding: 16px 20px; min-width: 0; }
.ap-fact + .ap-fact { border-left: 1px solid var(--line-2); }
.ap-fact-k { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--muted); }
.ap-fact-k .ti { width: 26px; height: 26px; border-radius: 8px; }
.ap-fact-k .ti .icon { width: 14px; height: 14px; }
.ap-fact-v { margin-top: 8px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.ap-fact-v.is-big { font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ap-kv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ap-kv-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; font-size: 14px; }
.ap-kv-list li + li { border-top: 1px dashed var(--line); }
.ap-kv-list span { color: var(--muted); font-weight: 600; }
.ap-kv-list b { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.ap-kv-list b a { color: var(--brand-text); }
.ap-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.ap-photo { position: relative; display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.ap-photo img { width: 100%; height: 100%; object-fit: cover; }
.ap-photo:hover { border-color: var(--brand); }
.ap-subhead { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.ap-terms { white-space: pre-line; color: var(--ink-2); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.ap-note-muted { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.ap-note-muted .icon { width: 16px; height: 16px; color: var(--faint); }
@media (max-width: 1100px) {
  .ap-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-fact:nth-child(3) { border-left: 0; }
  .ap-fact:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 760px) {
  .od-steps.ap-steps-4 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .ap-fact { padding: 12px 14px; }
  .ap-fact-v.is-big { font-size: 19px; }
}

/* ---------------------------------------------------------------- dealer groups: pricing note */
.ap-explain { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; margin-top: 16px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); }
.ap-explain b { display: block; font-weight: 700; }
.ap-explain p { color: var(--muted); font-size: 13.5px; margin-top: 3px; line-height: 1.55; }

/* ---------------------------------------------------------------- notifications */
.ap-notif-day { padding: 12px 20px 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.ap-notif-list > .ap-notif-day:first-child { border-top: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
.ap-notif { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; color: inherit; text-decoration: none !important; }
.ap-notif + .ap-notif { border-top: 1px solid var(--line-2); }
a.ap-notif:hover { background: var(--surface-2); color: inherit; }
.ap-notif .ti { margin-top: 1px; }
.ap-notif-main { flex: 1; min-width: 0; }
.ap-notif-title { font-weight: 600; color: var(--ink-2); line-height: 1.4; }
.ap-notif.is-unread .ap-notif-title { font-weight: 700; color: var(--ink); }
.ap-notif-body { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.ap-notif-end { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; font-size: 12.5px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.ap-unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
@media (max-width: 720px) {
  .ap-notif { padding: 12px 16px; }
  .ap-notif-day { padding: 10px 16px 6px; }
}

/* ---------------------------------------------------------------- audit log */
.ap-audit-row + .ap-audit-row { border-top: 1px solid var(--line-2); }
.ap-audit-row .ac-audit-sum { padding: 13px 18px; }
.ap-audit-row .ac-diff { margin-left: 66px; margin-right: 18px; }
.ap-audit-who { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--ink-2); }
@media (max-width: 720px) {
  .ap-audit-row .ac-audit-sum { padding: 12px 16px; }
  .ap-audit-row .ac-diff { margin: 0 16px 14px; }
}

/* ---------------------------------------------------------------- support tickets */
.ap-thread { border-top: 1px solid var(--line-2); }
.tk-msg .avatar[class*="ap-av-"] { border-radius: 11px; }
.avatar.ap-av-tape { background: var(--tape-soft); color: #b57400; }
.avatar.ap-av-violet { background: var(--violet-soft); color: var(--violet); }
.avatar.ap-av-coral { background: var(--danger-soft); color: var(--danger); }
.avatar.ap-av-mint { background: var(--success-soft); color: var(--success); }
.avatar.ap-av-sky { background: var(--sky-soft); color: var(--sky); }
.avatar.ap-av-blue { background: var(--blue-soft); color: var(--blue); }
:root[data-theme="dark"] .avatar.ap-av-tape { color: var(--tape); }
.ap-tk-layout .tk-bubble { border-radius: 4px 16px 16px 16px; }
.ap-tk-layout .tk-msg.is-staff .tk-bubble { border-radius: 16px 4px 16px 16px; }
.ap-tk-layout .tk-reply { border-radius: 0 0 var(--r-xl) var(--r-xl); }
.tk-layout.ap-tk-layout { margin-top: 18px; grid-template-columns: minmax(0, 1fr) 340px; }
.ap-tk-layout .om-subsection { padding: 14px 20px 18px; border-top-color: var(--line-2); }
.ap-tk-layout .tk-other { padding: 3px 0; }
@media (max-width: 1100px) { .tk-layout.ap-tk-layout { grid-template-columns: minmax(0, 1fr); } }
