body.admin { background: #fafafb; }
[hidden] { display: none !important; }

/* Giriş */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 400px at 50% -10%, var(--brand-soft), transparent 60%); }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 24px;
  padding: 32px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login-brand { text-align: center; margin-bottom: 8px; }
.login-brand .wordmark { font-size: 26px; margin-top: 6px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input, select { font: inherit; border: 1.5px solid var(--fill); background: var(--fill); border-radius: 12px; padding: 11px 14px; color: var(--ink); }
input:focus, select:focus { outline: none; border-color: var(--brand); background: #fff; }
.form-error { color: var(--brand-dark); font-size: 14px; min-height: 1em; }
.back { text-align: center; }
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:disabled { opacity: .4; cursor: default; }
.btn-sm { padding: 8px 14px; font-size: 14px; }

/* Üst çubuk */
.admin-top { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); }
.admin-top-inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tag { margin-left: 8px; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand-dark); padding: 3px 8px; border-radius: 999px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.period { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.period select { padding: 8px 12px; }
.admin-main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 20px; }

/* Göstergeler */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; }
.kpi .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi .value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.kpi .value.red { color: var(--brand); }
.kpi .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head.wrap { flex-wrap: wrap; align-items: center; }
.panel-head h3 { margin: 0; font-size: 17px; }
.chart-box { position: relative; height: 280px; }

/* Huni */
.funnel { display: flex; flex-direction: column; gap: 14px; }
.funnel-row .top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.funnel-row .top b { font-size: 16px; }
.bar { height: 14px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.funnel-row:nth-child(2) .bar > span { background: #e5212f; }
.funnel-row:nth-child(3) .bar > span { background: #f06470; }
.funnel-row:nth-child(4) .bar > span { background: var(--ink); }

/* Tablolar */
.table-wrap { overflow-x: auto; }
table { font-size: 14px; }
th { white-space: nowrap; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafafb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
#listing-table tbody tr { cursor: pointer; }
#listing-table tbody tr:hover { background: #fff7f8; }
.bg { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 800; font-size: 12.5px; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--fill); color: var(--muted); white-space: nowrap; }
.pill.active { background: var(--success-soft); color: var(--success); }
.pill.fulfilled { background: #e8eefc; color: var(--info); }
.pill.expired { background: var(--warning-soft); color: var(--warning); }
.pill.removed { background: var(--brand-soft); color: var(--brand-dark); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select { padding: 8px 12px; font-size: 14px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 14px; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.foot-note { text-align: center; }

/* Ayrıntı çekmecesi */
.drawer { position: fixed; inset: 0; z-index: 20; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(20, 22, 26, .35); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%); background: #fff; overflow-y: auto; padding: 28px; box-shadow: -10px 0 40px rgba(0, 0, 0, .12); }
.drawer-close { position: absolute; right: 16px; top: 12px; border: 0; background: var(--fill); width: 36px; height: 36px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.d-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; padding-right: 40px; }
.d-head .bg { min-width: 56px; height: 56px; border-radius: 18px; font-size: 18px; }
.d-head h2 { font-size: 20px; margin: 0 0 4px; }
.d-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.d-grid .kpi { padding: 12px 14px; }
.d-grid .kpi .value { font-size: 22px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 12px 16px; position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.drawer h4 { margin: 22px 0 10px; font-size: 15px; }

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .period, #admin-email, .tag { display: none; }
  .admin-top-inner { padding: 0 16px; }
  .filters { width: 100%; }
  .filters input { flex: 1; min-width: 0; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 24px; }
  .d-grid { grid-template-columns: 1fr 1fr; }
}
