/* Zilolsoft Admin Kit v1 — kanonik manba: payer/public/admin-kit.css */
:root {
  --bg: #ffffff;
  --bg2: #f0f2f5;
  --card: #ffffff;
  --fg: #111827;
  --fg2: #6b7280;
  --border: #e5e7eb;
  --accent: #2481cc;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --ok-bg: #dcfce7; --ok-fg: #15803d;
  --bad-bg: #fee2e2; --bad-fg: #b91c1c;
  --wait-bg: #fef9c3; --wait-fg: #92400e;
  --info-bg: #dbeafe; --info-fg: #1e40af;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #17212b; --bg2: #0e1621; --card: #1e2c3d;
    --fg: #edf2f7; --fg2: #8a9bb5; --border: #2b3d52;
    --accent: #3a9aee;
    --ok-bg: #14532d; --ok-fg: #86efac;
    --bad-bg: #450a0a; --bad-fg: #fca5a5;
    --wait-bg: #422006; --wait-fg: #fcd34d;
    --info-bg: #1e3a5f; --info-fg: #93c5fd;
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #17212b; --bg2: #0e1621; --card: #1e2c3d;
  --fg: #edf2f7; --fg2: #8a9bb5; --border: #2b3d52;
  --accent: #3a9aee;
  --ok-bg: #14532d; --ok-fg: #86efac;
  --bad-bg: #450a0a; --bad-fg: #fca5a5;
  --wait-bg: #422006; --wait-fg: #fcd34d;
  --info-bg: #1e3a5f; --info-fg: #93c5fd;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--fg);
  font-size: 15px; line-height: 1.5;
  min-height: 100vh;
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

.loading-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; gap: 16px; color: var(--fg2); }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: ak-spin .75s linear infinite; }
@keyframes ak-spin { to { transform: rotate(360deg); } }

.page-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 10px 16px; display: flex; align-items: center; gap: 10px;
}
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.hdr-info { flex: 1; min-width: 0; }
.hdr-name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-sub { font-size: 12px; color: var(--fg2); }
.role-chip { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .3px; flex-shrink: 0; background: var(--info-bg); color: var(--info-fg); }
.role-chip.creator { background: var(--ok-bg); color: var(--ok-fg); }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--card); border-top: 1px solid var(--border);
  display: flex; padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-btn {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 2px 6px; background: none; border: none; cursor: pointer;
  color: var(--fg2); font-size: 10px; font-weight: 500; transition: color .15s; font-family: inherit;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-btn.active { color: var(--accent); }
.nav-icon { font-size: 22px; line-height: 1; display: block; }

.tab { display: none; padding: 16px; }
.tab.active { display: block; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.stat-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); padding: 14px 16px; min-width: 0; }
.stat-val { font-size: 28px; font-weight: 700; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-lbl { font-size: 12px; color: var(--fg2); margin-top: 4px; }
.c-accent { color: var(--accent); }
.c-success { color: var(--success); }
.c-warning { color: var(--warning); }
.c-danger { color: var(--danger); }

.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); padding: 14px 16px; margin-bottom: 10px; }
.card-row { display: flex; align-items: flex-start; gap: 10px; }
.card-title { font-weight: 600; font-size: 15px; }
.card-sub { font-size: 13px; color: var(--fg2); margin-top: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; transition: opacity .15s; min-height: 44px;
  font-family: inherit; text-decoration: none; color: inherit;
}
.btn:active { opacity: .7; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--bg2); color: var(--fg); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 13px; min-height: 36px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--bg2); color: var(--fg2); }
.badge.active, .badge.confirmed { background: var(--ok-bg); color: var(--ok-fg); }
.badge.inactive, .badge.error, .badge.failed { background: var(--bad-bg); color: var(--bad-fg); }
.badge.pending { background: var(--wait-bg); color: var(--wait-fg); }
.badge.expired, .badge.cancelled { background: var(--bg2); color: var(--fg2); }

.key-wrap { margin-bottom: 14px; }
.key-lbl { font-size: 11px; font-weight: 700; color: var(--fg2); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 5px; }
.key-box {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 70px 10px 12px; font-family: 'SFMono-Regular', Consolas, monospace; font-size: 13px;
  word-break: break-all; position: relative;
}
.copy-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 9px; font-size: 12px; cursor: pointer; color: var(--fg2); font-family: inherit;
}

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--fg2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.form-input {
  width: 100%; padding: 11px 14px; background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 15px; color: var(--fg); outline: none;
  font-family: inherit; min-height: 44px; transition: border-color .15s;
}
.form-input:focus { border-color: var(--accent); }
.form-hint { font-size: 12px; color: var(--fg2); margin-top: 5px; }

.sec-title { font-size: 11px; font-weight: 700; color: var(--fg2); text-transform: uppercase; letter-spacing: .6px; margin: 20px 0 10px; }
.sec-title:first-child { margin-top: 0; }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; display: flex; gap: 8px; }
.alert-info { background: var(--info-bg); color: var(--info-fg); }
.alert-success { background: var(--ok-bg); color: var(--ok-fg); }
.alert-error { background: var(--bad-bg); color: var(--bad-fg); }
.alert-warning { background: var(--wait-bg); color: var(--wait-fg); }

.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 12px; color: var(--fg2); margin-top: 2px; }
.list-right { flex-shrink: 0; text-align: right; }
.list-amt { font-weight: 700; font-size: 15px; }

.center-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; text-align: center; padding: 24px; gap: 14px; }
.cs-icon { font-size: 56px; }
.cs-title { font-size: 20px; font-weight: 700; }
.cs-desc { color: var(--fg2); font-size: 15px; line-height: 1.6; max-width: 280px; }

.empty { text-align: center; padding: 32px 16px; color: var(--fg2); }
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-text { font-size: 14px; }

.sub-tabs { display: flex; background: var(--bg2); border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.sub-tab { flex: 1; padding: 8px 6px; text-align: center; font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 8px; color: var(--fg2); }
.sub-tab.active { background: var(--card); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; }
.modal-sheet {
  background: var(--bg); width: 100%; border-radius: 18px 18px 0 0;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 88vh; overflow-y: auto;
  animation: ak-slide-up .2s ease-out;
}
@keyframes ak-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-drag { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 12px auto 16px; }
.modal-title { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 16px; }

.sw { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; background: var(--border); border-radius: 26px; cursor: pointer; transition: background .2s; }
.sw span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.sw input:checked + span { background: var(--success); }
.sw input:checked + span::before { transform: translateX(20px); }
.sw input:disabled + span { opacity: .5; cursor: default; }

.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 200;
  transform: translate(-50%, 16px); max-width: calc(100% - 32px); width: max-content;
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 500; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.2);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }

.bar-chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: 8px; }
.bar-chart .bar { flex: 1; min-width: 2px; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .85; }
.bar-chart .bar.zero { background: var(--border); }
.bar-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--fg2); margin-top: 4px; }
