:root {
  --ink: #0b0c0a;       /* fon */
  --panel: #151614;     /* kartlar */
  --raised: #1e1f1c;    /* düymə, xana */
  --line: #262824;
  --text: #f1f3ec;
  --muted: #8a8d84;
  --lime: #d4f56a;
  --lime-ink: #151a05;
  --green: #3fbf5f;
  --orange: #f5a524;
  --red: #ff6b5e;
  --violet-1: #1f1830;
  --violet-2: #3a2a66;
  --r: 22px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--text); font: 500 14px/1.45 var(--body); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 600; }

.app { display: grid; grid-template-columns: 76px minmax(0, 1fr) 340px; gap: 14px; padding: 14px; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.side { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0;
  background: var(--panel); border-radius: var(--r); position: sticky; top: 14px; height: calc(100vh - 28px); }
.logo { width: 46px; height: 46px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; margin-bottom: 14px; }
.logo svg { width: 22px; height: 22px; fill: none; stroke: var(--lime-ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.nav { width: 46px; height: 46px; border-radius: 14px; border: 0; background: var(--raised); display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.nav svg { width: 21px; height: 21px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav:hover svg { stroke: var(--text); }
.nav.on { background: var(--lime); }
.nav.on svg { stroke: var(--lime-ink); }
.side-spacer { flex: 1; }

/* ---------- Əsas ---------- */
.main { background: var(--panel); border-radius: var(--r); padding: 26px 26px 18px; display: flex; flex-direction: column; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
h1 { font: 600 30px/1.1 var(--display); margin: 0; letter-spacing: -.01em; }
.lead { margin: 8px 0 0; color: var(--muted); }
.lead b { color: var(--text); }
.search { position: relative; flex: 0 1 300px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search input { width: 100%; padding: 11px 14px 11px 38px; border-radius: 12px; border: 1px solid transparent; background: var(--raised); }
.search input::placeholder { color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 11px; border: 0;
  background: var(--raised); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.chip .n { color: var(--muted); font-weight: 700; }
.chip:hover { background: #262723; }
.chip.on, .chip[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); }
.chip.on .n { color: var(--lime-ink); opacity: .6; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.selects { display: flex; gap: 8px; margin-left: auto; }
select { padding: 9px 30px 9px 12px; border-radius: 11px; border: 0; background: var(--raised); font-weight: 600; font-size: 13px;
  appearance: none; cursor: pointer; max-width: 240px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--panel); }

/* ---------- Cədvəl ---------- */
.table-wrap { flex: 1; overflow: auto; margin: 0 -10px; }
/* Cədvəl sığanda (.fits, widgets.js watchTableFit) səhifə ilə sürüşür → başlıq (sticky) ekranın yuxarısında qalır.
   Sığmayanda overflow: auto — cədvəl öz daxilində yana sürüşür, sağdakı kartların altına daşmır. */
@media (min-width: 1100px) { .table-wrap.fits { overflow: visible; } }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: left; padding: 10px 7px; font-size: 12px; font-weight: 600;
  color: var(--muted); cursor: pointer; white-space: nowrap; user-select: none; }
th:hover { color: var(--text); }
th .arr { font-style: normal; font-size: 10px; }
td { padding: 9px 7px; border-top: 1px solid var(--line); vertical-align: middle; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Məhsul sütunu qalan yeri tutur və sıxılır (uzun ad … ilə kəsilir, tam adı title-da) — cədvəl sağdakı kartların altına daşmasın */
.pcol { width: 100%; max-width: 0; min-width: 170px; }
tbody tr:not(.group-row):hover td { background: var(--raised); }
tbody tr:not(.group-row):hover td:first-child { border-radius: 12px 0 0 12px; }
tbody tr:not(.group-row):hover td:last-child { border-radius: 0 12px 12px 0; }
.pname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmeta { font-size: 12px; color: var(--muted); line-height: 1.5; } /* sığmayanda ID · kateqoriya · qovluq yeni sətrə keçir — linklər gizlənmir */
.pmeta b { color: var(--orange); font-weight: 600; }
.group-row td { padding-top: 20px; border-top: 0; }
.group-row .gname { color: var(--lime); font-weight: 700; }
.group-row .gcount { color: var(--muted); margin-left: 14px; font-size: 13px; }
.cost-in { width: 92px; padding: 7px 10px; border-radius: 10px; border: 1px dashed #3a3d36; background: transparent; text-align: right; font-weight: 700; }
.cost-in::placeholder { color: #50534c; }
.cost-in:hover { border-color: var(--muted); }
.cost-in:focus { border-style: solid; border-color: var(--lime); outline: none; background: var(--ink); }
.cost-in.filled { border-style: solid; border-color: transparent; background: var(--raised); color: var(--lime); }
.v { display: inline-block; padding: 3px 8px; border-radius: 8px; cursor: copy; font-weight: 700; }
.v:hover { background: var(--raised); }
.v-min { color: var(--orange); }
.v-max { color: var(--lime); }
.v-black { color: #c9ccc2; }
.dash { color: #464943; }
.cheaper { color: var(--red); }
.pos { color: var(--text); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.p-ok { background: var(--lime); color: var(--lime-ink); }
.p-low { background: rgba(245, 165, 36, .16); color: var(--orange); }
.p-high { background: var(--raised); color: #c9ccc2; }
.p-loss { background: rgba(255, 107, 94, .16); color: var(--red); }
.p-none { color: #5d6058; font-size: 12px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: 6px; flex-wrap: wrap; }
.pager #count { color: var(--muted); }
.pager #count b { color: var(--text); }
.pages { display: flex; gap: 4px; align-items: center; }
.pg { min-width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.pg:hover:not(:disabled) { color: var(--text); }
.pg.on { background: var(--raised); color: var(--text); }
.pg:disabled { opacity: .3; cursor: default; }

/* ---------- Sağ sütun ---------- */
.rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 14px; height: calc(100vh - 28px); overflow: auto; }
.card { background: var(--panel); border-radius: var(--r); padding: 20px; border: 0; text-align: left; }
.card-head { display: flex; justify-content: space-between; align-items: center; }

/* Hava — imza kartı */
.weather { position: relative; overflow: hidden; min-height: 330px;
  background: radial-gradient(120% 80% at 90% 100%, var(--violet-2) 0%, transparent 60%),
              radial-gradient(90% 60% at 0% 0%, #2a2340 0%, transparent 70%), var(--violet-1); }
.weather::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(170, 130, 255, .25), transparent 70%); pointer-events: none; }
.w-head { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.w-city { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .07); border-radius: 10px; padding-left: 10px; }
.w-city svg { width: 14px; height: 14px; fill: none; stroke: var(--lime); stroke-width: 2; }
.w-city select { background-color: transparent; padding-left: 4px; }
.w-main { display: flex; align-items: center; gap: 12px; margin: 16px 0 10px; transition: opacity .2s; }
.w-main.is-loading { opacity: .5; }
.w-temp { font: 600 52px/1 var(--display); letter-spacing: -.03em; }
.w-text { color: #c7bfdc; font-size: 13px; margin-top: 6px; }
.w-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.w-metrics div { background: rgba(255, 255, 255, .05); border-radius: 12px; padding: 8px 10px; }
.w-metrics span { display: block; font-size: 11px; color: #a79fbe; }
.w-metrics b { font-size: 14px; }
.w-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 14px 0; min-height: 76px; }
.w-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; }
.w-cell span { color: #a79fbe; }
.w-strip:has(.w-day) { grid-template-columns: 1fr; gap: 6px; }
.w-day { display: grid; grid-template-columns: 1fr 26px 42px 68px; align-items: center; gap: 8px; font-size: 13px; }
.w-day em { font-style: normal; color: #8fb8ff; font-size: 12px; text-align: right; }
.w-day b { text-align: right; }
.w-day i { font-style: normal; color: #a79fbe; font-weight: 500; }
.w-msg { color: #c7bfdc; margin: 30px 0; }
.w-actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; position: relative; z-index: 1; }
.btn-dark, .btn-lime, .btn-danger { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 700; cursor: pointer; }
.btn-dark { background: rgba(0, 0, 0, .45); color: var(--text); }
.btn-dark:hover { background: rgba(0, 0, 0, .7); }
.btn-lime { background: var(--lime); color: var(--lime-ink); }
.btn-lime:hover { filter: brightness(1.06); }
.btn-danger { background: rgba(255, 107, 94, .14); color: var(--red); }
.btn-dark:disabled { opacity: .6; cursor: default; }

/* İkonlar */
.w-icon { overflow: visible; flex: none; }
.w-sun circle { fill: #ffd466; }
.w-sun line { stroke: #ffd466; stroke-width: 3; stroke-linecap: round; }
.w-sun { transform-origin: 32px 32px; animation: spin 40s linear infinite; }
.w-moon { fill: #e6ddff; }
.w-cloud { fill: #ece8f7; }
.w-drop { stroke: #8fb8ff; stroke-width: 2.5; stroke-linecap: round; animation: drop 1.1s ease-in infinite; }
.w-flake { fill: #fff; animation: drop 2s linear infinite; }
.w-fog { stroke: #c7bfdc; stroke-width: 3; stroke-linecap: round; }
.w-bolt { fill: #ffd466; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drop { 0% { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(5px); opacity: 0; } }

/* Bazar mövqeyi */
.tag { background: var(--lime); color: var(--lime-ink); font-weight: 800; font-size: 12px; padding: 4px 9px; border-radius: 8px; }
.big { font: 600 24px/1.2 var(--display); margin: 8px 0 14px; }
.big small { font: 500 13px var(--body); color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.bar { flex: 1; border-radius: 6px 6px 3px 3px; background: linear-gradient(to top, #1d4a26, var(--green)); position: relative; cursor: pointer; min-height: 4px; border: 0; padding: 0; }
.bar.first { background: var(--lime); }
.bar:hover::after, .bar:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #2a2c27; color: var(--text); font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 7px; white-space: nowrap; z-index: 2; }
.bars-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 8px; }

.rail-row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; }
.gauge-card { position: relative; padding-bottom: 14px; }
.gauge { width: 100%; display: block; transform: rotate(135deg); }
.g-track { fill: none; stroke: #33352f; stroke-width: 2; stroke-dasharray: 2 6; }
.g-fill { fill: none; stroke: var(--lime); stroke-width: 16; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.g-wrap { position: relative; max-width: 160px; margin: 4px auto 0; }
.g-val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.g-val small { display: block; }
.g-val b { font: 600 22px var(--display); }
.g-val small { color: var(--muted); font-size: 12px; }
.loss-card { display: flex; flex-direction: column; align-items: center; justify-content: space-between; cursor: pointer; color: var(--text);
  background: radial-gradient(90% 70% at 50% 110%, rgba(255, 107, 94, .22), transparent 70%), var(--panel); }
.loss-card:hover { filter: brightness(1.15); }
.loss-card .eyebrow { align-self: flex-start; }
.loss-ico { width: 30px; height: 30px; fill: none; stroke: var(--red); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.loss-card b { font: 600 30px/1 var(--display); }
.loss-card small { color: var(--muted); }

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; justify-content: flex-end; z-index: 20; }
.drawer[hidden] { display: none; }
.drawer-box { width: min(560px, 100%); height: 100%; overflow: auto; background: var(--panel); padding: 26px; border-left: 1px solid var(--line); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer h2 { font: 600 22px var(--display); margin: 0; }
.drawer h3 { font-size: 15px; margin: 26px 0 4px; }
.x { border: 0; background: var(--raised); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.fields label { font-weight: 700; font-size: 13px; }
.fields small { display: block; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.fields input, .cat-search, .cat-list input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); }
.cat-search { margin: 8px 0; }
.cat-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.cat-list td { border-top: 1px solid var(--line); padding: 6px 12px; }
.cat-list tr:first-child td { border-top: 0; }
.cat-list input { width: 76px; text-align: right; padding: 6px 8px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.steps { padding-left: 20px; margin: 16px 0 0; }
.steps li { margin-bottom: 10px; }
.gloss td { border-top: 1px solid var(--line); padding: 9px 8px; vertical-align: top; }
.gloss td:first-child { color: var(--lime); font-weight: 700; white-space: nowrap; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 10px); background: var(--lime); color: var(--lime-ink); font-weight: 700;
  padding: 10px 18px; border-radius: 12px; opacity: 0; transition: .2s; pointer-events: none; z-index: 30; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsiv ---------- */
@media (max-width: 1250px) {
  .app { grid-template-columns: 76px minmax(0, 1fr); }
  .rail { grid-column: 2; position: static; height: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; padding: 8px; gap: 8px; }
  .side { position: static; height: auto; flex-direction: row; justify-content: flex-start; padding: 8px 12px; overflow-x: auto; }
  .logo { margin: 0 6px 0 0; }
  .side-spacer { display: none; }
  .rail { grid-column: 1; grid-template-columns: 1fr; }
  .main { padding: 18px 14px; }
  .selects { margin-left: 0; width: 100%; }
  .selects select { flex: 1; max-width: none; }
  .fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Server ilə əlaqə */
.new-tag { display: inline-block; background: var(--lime); color: var(--lime-ink); font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 6px; margin-right: 7px; vertical-align: 1px; }
.lead .lime { color: var(--lime); }
.lead .warn { color: var(--orange); cursor: help; }
#saveState { font-size: 12.5px; color: var(--muted); margin-right: auto; }
#saveState[data-state="saved"] { color: var(--green); }
#saveState[data-state="error"] { color: var(--red); }

/* Giriş ekranı */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(60% 50% at 80% 90%, var(--violet-2), transparent 70%), radial-gradient(50% 40% at 10% 0%, #1f2a10, transparent 70%), var(--ink); }
.login[hidden], .app[hidden] { display: none; }
.login-card { width: min(420px, 100%); background: var(--panel); border-radius: var(--r); padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.login-card .logo { margin: 0 0 4px; }
.login-card h1 { font-size: 26px; }
.login-card .lead { margin: 0; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 13px; }
.login-card input { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink); font-size: 15px; }
.login-card input:focus { outline: none; border-color: var(--lime); }
.login-card .btn-lime { padding: 14px; font-size: 15px; }
.login-card .btn-lime:disabled { opacity: .6; cursor: wait; }
.login-err { color: var(--red); margin: 0; min-height: 1em; font-size: 13.5px; }
.login-note { color: var(--muted); font-size: 12px; margin: 0; }
.lead .auth-warn { color: var(--red); font-weight: 700; }
.login-hint { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.login-card input::placeholder { color: #4d5048; }

/* Qovluq / kateqoriya seçiciləri */
.picker { max-width: 280px; }
.picker span { overflow: hidden; text-overflow: ellipsis; }
.picker .caret { font-style: normal; opacity: .6; font-size: 11px; }
.picker.active { background: var(--lime); color: var(--lime-ink); }
.toolbar .filters { width: 100%; }
.pop { position: fixed; z-index: 25; width: 360px; max-height: min(520px, 70vh); display: flex; flex-direction: column;
  background: #1b1c19; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.55); overflow: hidden; }
.pop[hidden] { display: none; }
.pop-head { padding: 12px; display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.pop-head input { flex: 1; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); }
.pop-list { overflow: auto; padding: 6px; }
.pop-item { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; padding: 9px 10px;
  border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; }
.pop-item:hover, .pop-item:focus-visible { background: var(--raised); }
.pop-item.on { background: rgba(212, 245, 106, .12); }
.pop-item.on .pi-name { color: var(--lime); }
.pi-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-count { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pi-bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: #2b2d28; overflow: hidden; }
.pi-bar i { display: block; height: 100%; background: var(--lime); }
.pi-sub { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }
.pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pop-foot { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.pop-foot input { flex: 1; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); }
.pop-empty { padding: 18px; color: var(--muted); text-align: center; font-size: 13px; }
.seg { display: inline-flex; background: var(--ink); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--raised); color: var(--text); }
.fi-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 4px; }
.fi-act { border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.fi-act:hover { background: var(--raised); color: var(--text); }
.fi-act.danger:hover { color: var(--red); }
.fi-edit { display: flex; gap: 6px; padding: 4px; }
.fi-edit input { flex: 1; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--lime); background: var(--ink); }
.btn-lime.sm, .btn-dark.sm { padding: 8px 12px; font-size: 13px; }

/* Bot API */
.key-box { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; word-break: break-all; color: var(--lime); }
.key-box.empty { color: var(--muted); font-family: var(--body); }
.api-ex { background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.api-ex > code { font-size: 12.5px; color: var(--lime); word-break: break-all; }
.api-ex small { color: var(--muted); font-size: 12px; }
.drawer code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--raised); padding: 1px 5px; border-radius: 5px; }
.api-ex > code, .key-box code { background: none; padding: 0; }
/* Bot funksiyaları (botfeatures.js) */
.bot-features { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.bf-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; }
.bf-row > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bf-row small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.bf-row.dim { opacity: .5; }
.sw { flex-shrink: 0; width: 42px; height: 24px; border-radius: 12px; border: 0; padding: 0; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.sw.on { background: var(--lime); }
.sw.on::after { transform: translateX(18px); background: var(--lime-ink); }
.bf-folders { background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.bf-folders-head { display: flex; gap: 8px; margin-bottom: 8px; }
.bf-folders-head input { flex: 1; min-width: 0; background: var(--panel, #1a1b18); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; }
.bf-folder-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; }
.bf-folder-list label { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 8px; cursor: pointer; }
.bf-folder-list label:hover { background: rgba(255, 255, 255, .04); }
.bf-folder-list input { accent-color: var(--lime); }
.bf-row > .btn-dark { white-space: nowrap; flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) { .sw, .sw::after { transition: none; } }

.api-out { background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 12px; max-height: 320px;
  overflow: auto; white-space: pre-wrap; color: #cfd3c7; margin-top: 10px; }

/* Seçim */
th.chk, td.chk { width: 34px; padding-right: 0; }
.chk input { width: 16px; height: 16px; accent-color: var(--lime); cursor: pointer; }
tr.sel td { background: rgba(212, 245, 106, .07); }
.selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px;
  background: var(--raised); border: 1px solid rgba(212, 245, 106, .35); border-radius: 14px; }
.selbar[hidden] { display: none; }
.selbar .grow { flex: 1; }
.cat-link { border: 0; background: none; padding: 0; color: var(--red); font-weight: 600; font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.cat-link:hover { color: #ff8f85; }
.fold-tag { display: inline-flex; align-items: center; gap: 3px; color: #cdb8ff; border: 0; background: none; padding: 0; font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.fold-tag:hover { color: #e2d6ff; }

/* Komissiya % xanası: rəng mənbəni göstərir — tarif (adi), əl ilə (lime), standart (solğun) */
.pct-in { width: 58px; padding: 6px 8px; border-radius: 9px; border: 1px solid transparent; background: transparent; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pct-in:hover { border-color: #3a3d36; }
.pct-in:focus { outline: none; border-color: var(--lime); background: var(--ink); }
.pct-in.src-manual { color: var(--lime); border-color: rgba(212, 245, 106, .35); }
.pct-in.src-default { color: var(--muted); font-weight: 500; font-style: italic; }
.pct-in.bad { border-color: var(--red); color: var(--red); }
.tariff-box { background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.tariff-box p { margin: 8px 0 0; font-size: 12.5px; }
.cat-list small { font-size: 11px; }

/* ---------- Hesablama səhifəsi ---------- */
.calc-view { gap: 16px; }
.main[hidden] { display: none; }
.calc-view .top { margin-bottom: 4px; align-items: center; }
.calc-card { background: var(--raised); border-radius: 18px; padding: 20px; }
.calc-card h2 { font: 600 17px var(--display); margin: 0 0 6px; }
.calc-card > .muted { margin: 0 0 14px; font-size: 13.5px; }
.calc-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
.calc-fields label { font-weight: 700; font-size: 13px; }
.calc-fields input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); font-weight: 700; }
.calc-fields input:focus, .fee-table input:focus, .fee-table select:focus { outline: none; border-color: var(--lime); }
.calc-view input.bad { border-color: var(--red) !important; color: var(--red); }
.table-scroll { overflow-x: auto; }
.fee-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.fee-table th { position: static; background: none; font-size: 11.5px; padding: 8px; cursor: default; }
.fee-table td { padding: 7px 8px; border-top: 1px solid var(--line); }
.fee-table .c { text-align: center; width: 54px; }
.fee-table tr.off td { opacity: .45; }
.fee-table tr.off td:first-child { opacity: 1; }
.fee-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--lime); cursor: pointer; }
.fee-name { width: 100%; min-width: 180px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--ink); font-weight: 600; }
.fee-table select { padding: 8px 28px 8px 10px; border: 1px solid var(--line); background-color: var(--ink); max-width: 210px; }
.fee-kind { font-size: 12.5px; color: var(--muted); }
.fee-val { width: 70px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--ink); text-align: right; font-weight: 700; }
.calc-warn p { color: var(--red); font-weight: 600; margin: 10px 0 0; }
.formula-row { display: grid; grid-template-columns: 90px 1fr; gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.formula-row:first-child { border-top: 0; padding-top: 4px; }
.formula-row b { color: var(--lime); grid-row: span 2; }
.formula-row code { font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; color: var(--text); }
.formula-row small { color: var(--muted); font-size: 12.5px; }
.bd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.bd { background: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.bd-empty { color: var(--muted); font-size: 13px; display: grid; place-items: center; text-align: center; }
.bd-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.bd-head .num { font: 600 20px var(--display); color: var(--lime); }
.bd table td { border-top: 1px solid var(--line); padding: 6px 4px; font-size: 13px; }
.bd table td.muted { font-size: 11.5px; }
.bd .bd-total td { font-weight: 800; }
.bd small { display: block; margin-top: 8px; font-size: 12px; }
.bd small.ok { color: var(--green); }
.bd small.bad { color: var(--red); }
.link-btn { border: 0; background: none; padding: 0; color: var(--lime); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 1100px) { .calc-fields, .bd-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .calc-fields, .bd-grid { grid-template-columns: 1fr; } }
.pid { color: #cdb8ff; font-weight: 700; cursor: copy; }
.pid:hover { text-decoration: underline; }
.fi-act.on { color: var(--lime); background: rgba(212, 245, 106, .14); }

/* Min/Max/Qara altında gəlir */
.gain { display: block; font-size: 11px; font-weight: 600; color: #7fd88f; margin-top: 1px; }
.gain.neg { color: var(--red); }
/* Mağaza loqosu */
.side .logo { overflow: hidden; }
.side .logo span { font: 700 20px var(--display); color: var(--lime-ink); }
.side .logo.has-img { background: #fff; }
.side .logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }

/* ---------- Mağaza seçicisi ---------- */
.top-right { display: flex; gap: 10px; align-items: center; flex: 0 1 520px; justify-content: flex-end; }
.top-right .search { flex: 1 1 260px; }
.store-switch { display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--raised); cursor: pointer; font-weight: 700; max-width: 240px; white-space: nowrap; }
.store-switch:hover { border-color: var(--lime); }
.store-switch .caret { font-style: normal; opacity: .6; font-size: 11px; }
.ss-name { overflow: hidden; text-overflow: ellipsis; }
.ss-logo, .sp-logo { width: 30px; height: 30px; border-radius: 9px; object-fit: contain; background: #fff; flex: none; }
.sp-logo { width: 24px; height: 24px; border-radius: 7px; vertical-align: middle; margin-right: 6px; }
.ss-logo.letter, .sp-logo.letter { display: inline-grid; place-items: center; background: var(--lime); color: var(--lime-ink); font: 700 14px var(--display); }
.store-row { grid-template-columns: 1fr auto; }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); }
.modal[hidden] { display: none; }
.modal .login-card h2 { font: 600 20px var(--display); margin: 0; }

/* ---------- Darvaza: iki qanad ortada bağlanır ---------- */
.gate { position: fixed; inset: 0; z-index: 60; pointer-events: all; overflow: hidden; }
.gate[hidden] { display: none; }
.gate-l, .gate-r { position: absolute; top: 0; bottom: 0; width: 50.5%; background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 28px),
    linear-gradient(180deg, #1b1c19, #0e0f0c); transition: transform .5s cubic-bezier(.77, 0, .18, 1); }
.gate-l { left: 0; transform: translateX(-101%); box-shadow: inset -3px 0 0 var(--lime); }
.gate-r { right: 0; transform: translateX(101%); box-shadow: inset 3px 0 0 var(--lime); }
.gate.closing .gate-l, .gate.closing .gate-r { transform: translateX(0); }
.gate.opening .gate-l { transform: translateX(-101%); }
.gate.opening .gate-r { transform: translateX(101%); }
.gate-label { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 28px 40px; border-radius: 26px; background: #0e0f0c; border: 1px solid rgba(212, 245, 106, .35); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  opacity: 0; transform: scale(.94); transition: opacity .25s ease, transform .35s ease; }
.gate.closing .gate-label { opacity: 1; transform: scale(1); transition-delay: .32s; }
.gate.opening .gate-label { opacity: 0; transition-duration: .15s; }
.gate-label b { font: 600 34px var(--display); color: var(--text); letter-spacing: -.01em; }
.gate-label small { color: var(--lime); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.gate-logo { width: 84px; height: 84px; border-radius: 22px; object-fit: contain; background: #fff; padding: 8px; box-shadow: 0 0 0 3px var(--lime); }
.gate-logo.letter { display: grid; place-items: center; background: var(--lime); color: var(--lime-ink); font: 700 38px var(--display); padding: 0; }
.gate.fade-in { background: var(--ink); opacity: 1; transition: opacity .15s; }
.gate.fade-in .gate-label { opacity: 1; transform: none; }
.gate.fade-out { background: var(--ink); opacity: 0; transition: opacity .15s; }
@media (max-width: 760px) { .top-right { flex-wrap: wrap; } .store-switch { max-width: 100%; } }

/* Digər mağazalardan maya köçürmə bildirişi */
.copy-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(212, 245, 106, .12), rgba(212, 245, 106, .04)); border: 1px solid rgba(212, 245, 106, .35); }
.copy-banner[hidden] { display: none; }
.copy-banner span { flex: 1 1 320px; font-size: 13.5px; }
.copy-banner b { color: var(--lime); }

/* Taksit krediti kartı */
.taksit .card-head { margin-bottom: 10px; }
.tk-price { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.tk-price input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); font-weight: 700; color: var(--text); }
.tk-price input:focus { outline: none; border-color: var(--lime); }
.tk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tk-table th { position: static; background: none; padding: 6px 4px; font-size: 11px; cursor: default; }
.tk-table td { padding: 6px 4px; border-top: 1px solid var(--line); }
.tk-table td b { font: 600 14px var(--display); }
.tk-table .tk-left { color: var(--lime); font-weight: 700; }
.tk-in { width: 56px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); text-align: right; font-weight: 700; }
.tk-in.bad { border-color: var(--red); color: var(--red); }

/* Sağ sütunda kartlar sıxılmasın (hava kartının düymələri kəsilirdi) — sütun özü sürüşür */
.rail > * { flex-shrink: 0; }
.pop-note { margin: 0; padding: 0 12px 12px; font-size: 11.5px; color: var(--muted); }
