/* ==========================================================================
   Afiş Stüdyo — yönetim paneli
   ========================================================================== */

body.admin-page {
  display: block;
  overflow: auto;
  background: var(--paper);
  background-image: radial-gradient(rgba(110, 95, 78, .08) 1px, transparent 1px);
  background-size: 18px 18px;
}
body.admin-page .topbar { position: sticky; top: 0; }

.brand-mark.admin-mark { background: linear-gradient(145deg, #2b2622, #17130f); box-shadow: 0 6px 14px rgba(20, 15, 10, .28); }
.admin-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .14em;
  background: #1c1916;
  color: #fff;
  padding: 5px 9px;
  border-radius: 7px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 24px 60px;
}

.admin-side {
  position: sticky;
  top: 86px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.admin-nav {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.admin-nav svg { width: 16px; height: 16px; opacity: .85; }
.admin-nav:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.admin-nav.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.admin-side-foot {
  margin-top: 18px;
  padding: 12px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
}
.admin-side-foot span { color: #2f7d4d; font-weight: 700; }

.admin-main { min-width: 0; }
.admin-view { display: none; }
.admin-view.on { display: block; animation: pop .16s ease-out; }

.admin-head h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.025em; }
.admin-head p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------- kartlar */

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat-card span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-card b { display: block; font-size: 27px; letter-spacing: -.02em; margin-top: 5px; line-height: 1.1; }
.stat-card small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.stat-card small em { font-style: normal; color: #2f7d4d; font-weight: 700; }

.acard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
}
.acard h3 {
  margin: 0 0 12px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink);
}
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }

/* ------------------------------------------------------------------ grafik */

.chart { display: flex; align-items: flex-end; gap: 8px; height: 132px; }
.chart .bar { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; }
.chart .bar em { font-style: normal; font-size: 9.5px; font-weight: 700; color: var(--ink-2); }
.chart .bar i {
  display: block;
  width: 100%;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #e63946, #b82027);
  transition: height .3s;
}
.chart .bar span { font-size: 9.5px; color: var(--muted); }
.chart-empty { height: 132px; width: 100%; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

.tpl-row { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: 11px; }
.tpl-row:last-child { margin-bottom: 0; }
.tpl-row .tpl-name { width: 120px; flex: none; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-row .tpl-bar { flex: 1; height: 8px; background: #f1ece4; border-radius: 99px; overflow: hidden; }
.tpl-row .tpl-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e63946, #b82027); border-radius: 99px; }
.tpl-row b { width: 26px; text-align: right; font-size: 11px; }

.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 11.5px; }
.list-row:last-child { border-bottom: 0; }
.list-row .lr-main { min-width: 0; }
.list-row .lr-main b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .lr-main span { display: block; font-size: 10px; color: var(--muted); }
.list-row .lr-side { flex: none; text-align: right; font-size: 10.5px; color: var(--muted); }
.list-row .lr-side b { display: block; color: var(--ink-2); font-size: 11px; }

/* ------------------------------------------------------------------ tablo */

.admin-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.admin-toolbar input {
  width: 100%;
  max-width: 380px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}
.admin-toolbar input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(215, 38, 46, .1); }
.toolbar-count { margin-left: auto; font-size: 11.5px; color: var(--muted); }

.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: auto; box-shadow: var(--shadow-sm); }
.table-wrap.table-plain { border: 0; border-radius: 0; box-shadow: none; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 720px; }
.admin-table th {
  text-align: left;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbf8f3;
  position: sticky;
  top: 0;
  z-index: 1;
}
.admin-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .ta-right, .admin-table th.ta-right { text-align: right; }

.u-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.u-cell .avatar { width: 30px; height: 30px; font-size: 11px; }
.u-cell div > b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.u-cell div > span { display: block; font-size: 10.5px; color: var(--muted); }

.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fdf6e5;
  color: #8a6a14;
  font-size: 11px;
  font-weight: 800;
}
.coin-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #f0b429 72%);
  box-shadow: inset 0 0 0 1px rgba(150, 100, 0, .25);
}

.role-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.role-badge.admin { background: #1c1916; color: #fff; }
.role-badge.user { background: #f1ece4; color: #6d6155; }

.row-actions { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.mini-btn {
  border: 1px solid var(--line);
  background: #fbf8f3;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 7px;
  white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s;
}
.mini-btn:hover { background: #f3ece2; border-color: #ddd2c2; }
.mini-btn.danger:hover { background: #fdecec; border-color: #e7b6b4; color: #a3241f; }
.mini-btn.good { background: #eef7f0; border-color: #cfe6d5; color: #2f7d4d; }
.mini-btn.good:hover { background: #e3f1e7; }

/* ---------------------------------------------------------------- afişler */

.admin-posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 14px; }
.admin-poster {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.ap-thumb { position: relative; aspect-ratio: 1240 / 1754; background: #f7f2ea; overflow: hidden; }
.ap-thumb img, .ap-thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-thumb .ap-hidden {
  position: absolute;
  inset: auto 8px 8px auto;
  background: rgba(20, 16, 12, .78);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 7px;
  border-radius: 999px;
}
.ap-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-body b { font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-body span { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-actions { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.ap-actions .mini-btn { padding: 4px 7px; }
.ap-actions a.mini-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* -------------------------------------------------------------- yetkisiz */

.admin-denied {
  max-width: 460px;
  margin: 60px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.denied-ic { font-size: 30px; margin-bottom: 10px; }
.admin-denied b { display: block; font-size: 17px; margin-bottom: 6px; }
.admin-denied p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.denied-actions { display: flex; gap: 8px; justify-content: center; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; padding: 16px 14px 40px; gap: 14px; }
  .admin-side { position: static; flex-direction: row; overflow: auto; padding-bottom: 4px; }
  .admin-nav { white-space: nowrap; }
  .admin-side-foot { display: none; }
  .admin-table { min-width: 760px; }
  .admin-badge { display: none; }
  .stat-card b { font-size: 22px; }
}

/* --------------------------------------------------- şifre değiştirme penceresi */
.modal-card input[type="password"] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.modal-card input[type="password"]::placeholder { color: #c3b8aa; }
.modal-card input[type="password"]:focus,
.modal-card input[type="password"]:focus-visible {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 38, 46, .1);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.pwd-hint { font-size: 11.5px; color: var(--muted); margin: 12px 0 0; line-height: 1.45; }
