/* Bireby Admin — dark + emerald (markaya uygun). Tek vurgu: emerald. Roboto. 8pt grid. */
:root {
  --bg: #0e1311;
  --surface: #161d1a;
  --surface-2: #1d2622;
  --border: #283430;
  --text: #e8efeb;
  --muted: #8aa098;
  --accent: #21c98a;
  --accent-ink: #04140d;
  --danger: #e5484d;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 8px 0 0; }

.brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.brand .muted { font-weight: 400; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* Inputs / buttons */
.input {
  width: 100%; padding: 11px 13px; margin-top: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px; font-family: inherit;
}
.input:focus { outline: none; border-color: var(--accent); }
.btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: filter .1s ease;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); width: 100%; margin-top: 14px; font-weight: 700; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }

/* Gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.gate-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.gate-card .brand { margin-bottom: 12px; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.container { max-width: 1080px; margin: 0 auto; padding: 24px 22px 60px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 30px; font-weight: 700; margin-top: 6px; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* RevenueCat kart ızgarası (panel içinde) */
.rc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; padding: 18px; }
.rc-grid .stat { background: var(--surface-2); }
.rc-note { padding: 18px; font-size: 14px; }
.rc-note.bad { color: var(--danger); }
.rc-note code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* Panel + table */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 17px; }
.search { width: 280px; margin-top: 0; max-width: 100%; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); }
.pill-pro { background: rgba(33,201,138,.14); color: var(--accent); border-color: transparent; }
.pill-paid { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.pill-sandbox { background: rgba(216,162,74,.16); color: #d8a24a; border-color: transparent; }
.pill-free { color: var(--muted); }

/* Düzenleme kutusu (detay modalı) */
.edit-box { margin-top: 18px; padding: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.edit-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.fld { display: block; font-size: 12px; color: var(--muted); margin-top: 8px; }
.fld .input { margin-top: 4px; }
.edit-row { display: flex; gap: 10px; }
.edit-row .fld { flex: 1; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; word-break: break-word; }
.modal h3 { margin: 0 0 4px; font-size: 18px; }
.modal .actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.action-row { display: flex; gap: 8px; align-items: center; }
.action-row .input { margin-top: 0; }
.action-row .btn { white-space: nowrap; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border); padding: 12px 20px; border-radius: 10px; z-index: 100; font-size: 14px; }
.toast.ok { border-color: var(--accent); }
.toast.bad { border-color: var(--danger); }
