/* ============================================================ Diginulls Panel */
:root {
  --bg: #f4f5fb; --panel: #ffffff; --panel-2: #f8f9fd; --line: #e7e8f2; --text: #171a2c; --muted: #6b7087;
  --accent: #6d5efc; --accent-2: #a855f7; --accent-h: #5b4be8; --accent-soft: #efedff;
  --ok: #10b981; --ok-soft: #e3f8ef; --warn: #f59e0b; --warn-soft: #fff4dc; --err: #ef4444; --err-soft: #fde8e8;
  --info: #0ea5e9; --info-soft: #e0f4fd;
  --side-1: #1b1740; --side-2: #2b2266; --side-text: #c9c5ee;
  --radius: 12px; --shadow: 0 1px 2px rgba(23, 26, 44, .04), 0 4px 16px rgba(23, 26, 44, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1020; --panel: #181a2e; --panel-2: #1f2238; --line: #2a2d47; --text: #e9eaf5; --muted: #9a9eb8;
    --accent-soft: #2a2552; --ok-soft: #12352b; --warn-soft: #3a2d10; --err-soft: #3d1a1d; --info-soft: #0f3042;
    --side-1: #0b0a1d; --side-2: #1a1545; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 "Inter", "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Layout */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--side-1), var(--side-2)); color: var(--side-text); padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-weight: 700; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--side-text); opacity: .8; }
.logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 18px;
  background: linear-gradient(135deg, #8b7dff, #e879f9); color: #fff; box-shadow: 0 4px 14px rgba(168, 85, 247, .45); }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #8e88c7; padding: 14px 12px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; color: var(--side-text);
  margin-bottom: 2px; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, rgba(139, 125, 255, .9), rgba(168, 85, 247, .75)); color: #fff;
  box-shadow: 0 4px 14px rgba(109, 94, 252, .35); }
.nav .ni { width: 20px; text-align: center; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 14px 6px; }
main { padding: 28px 36px; max-width: 1440px; width: 100%; min-width: 0; }
.menu-btn { display: none; }

h1 { font-size: 26px; font-weight: 700; margin: 0 0 18px; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-bottom: 4px; }
.sub { color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- Kartlar */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
  box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.sub-card { background: var(--panel-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 20px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.stat { position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px; color: #fff; box-shadow: var(--shadow);
  background: linear-gradient(135deg, #6d5efc, #a855f7); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); }
.grid .stat:nth-child(5n+2) { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.grid .stat:nth-child(5n+3) { background: linear-gradient(135deg, #10b981, #0d9488); }
.grid .stat:nth-child(5n+4) { background: linear-gradient(135deg, #f59e0b, #f97316); }
.grid .stat:nth-child(5n+5) { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.stat .k { font-size: 12.5px; opacity: .9; font-weight: 500; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.stat .ic { position: absolute; right: 16px; bottom: 12px; font-size: 26px; opacity: .35; }

/* ---------------------------------------------------------------- Cədvəllər */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: var(--panel-2); }
tr.hl td { background: var(--warn-soft); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* ---------------------------------------------------------------- Formalar */
form.inline { display: inline; }
label { display: block; font-weight: 600; font-size: 12.5px; color: var(--muted); margin: 12px 0 5px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; color: var(--text);
  background: var(--panel); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 110px; font-family: inherit; resize: vertical; }
textarea.code { font-family: Consolas, monospace; font-size: 12px; min-height: 260px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 400; color: var(--text); font-size: 14px; }
.check.small { font-size: 12px; margin-top: 4px; color: var(--muted); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.toolbar input[type=checkbox], td input[type=checkbox], th input[type=checkbox] { min-width: 0; width: auto; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; margin: 0; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd2e3; border-radius: 24px; transition: background .2s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff;
  border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(18px); }

/* ---------------------------------------------------------------- Düymələr */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; transition: all .15s; }
.btn:hover { background: var(--panel-2); border-color: #cfd2e3; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(109, 94, 252, .3); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(109, 94, 252, .4); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.success:hover { filter: brightness(1.06); background: var(--ok); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err-soft); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.tab { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: 13px; }
.tab:hover { background: var(--panel-2); text-decoration: none; color: var(--text); }
.tab.on { background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------------------- Nişanlar, bildirişlər */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--panel-2);
  color: var(--muted); border: 1px solid var(--line); }
.badge.ok, .badge.completed, .badge.paid { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn, .badge.processing, .badge.pending, .badge.review { background: var(--warn-soft); color: #b45309; border-color: transparent; }
.badge.err, .badge.failed, .badge.refunded, .badge.expired, .badge.rejected { background: var(--err-soft); color: var(--err); border-color: transparent; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #b8bccf; margin-right: 6px; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.warn { background: var(--warn); }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; border: 1px solid transparent; font-weight: 500; }
.flash.ok { background: var(--ok-soft); color: #047857; }
.flash.warn { background: var(--warn-soft); color: #92400e; }
.flash.err { background: var(--err-soft); color: #b91c1c; }
a.flash:hover { text-decoration: none; filter: brightness(.98); }
@media (prefers-color-scheme: dark) { .flash.ok { color: #6ee7b7; } .flash.warn { color: #fcd34d; } .flash.err { color: #fca5a5; } }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.mono { font-family: Consolas, monospace; font-size: 12px; word-break: break-all; }
.pager { display: flex; gap: 6px; margin-top: 12px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 500; }

/* ---------------------------------------------------------------- Ödəniş üsulu kartları */
.method-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin-top: 14px; }
.method-grid > .empty { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: var(--radius); }
.method { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--panel); transition: box-shadow .15s; }
.method:hover { box-shadow: var(--shadow); }
.method.is-off { background: var(--panel-2); }
.method.is-off .method-icon { filter: grayscale(1); opacity: .6; }
.method-top { display: flex; align-items: center; gap: 12px; }
.method-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); flex: none; }
.method-body { white-space: pre-line; margin: 10px 0 4px; font-size: 13px; }
.method-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ---------------------------------------------------------------- Giriş */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 20% 20%, #8b7dff55, transparent 45%), radial-gradient(circle at 80% 80%, #e879f955, transparent 45%), var(--bg); }
.login { width: 100%; max-width: 380px; margin: 0; }
.login .brand { color: var(--text); padding: 0 0 16px; }
.login .brand small { color: var(--muted); }

/* ---------------------------------------------------------------- Mobil */
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } main { padding: 20px; } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .menu-btn { display: inline-flex; margin-bottom: 14px; padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line);
    background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
  main { padding: 16px; }
  .card { padding: 16px; overflow-x: auto; }
  h1 { font-size: 22px; }
}
