/* =========================================================
   css/admin.css — باشقۇرۇش تاختىسى / 管理后台样式
   ---------------------------------------------------------
   · قاراڭغۇ نېئون ئۇسلۇب (كىچىك پروگرامما بىلەن بىردەك)
   · RTL ئاساسىي: 维吾尔语 ئوڭدىن سولغا، سان/ئېلخەت LTR
   · ھېچقانداق CDN يوق — ھەممە يەرلىك، تور يوقمۇ ئىشلەيدۇ
   ========================================================= */
@font-face {
  font-family: "UKIJ Ekran";
  src: url("../fonts/UKIJEkran.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg:        #06090a;
  --bg-soft:   #0a0f11;
  --panel:     #0f1518;
  --panel-2:   #131b1f;
  --panel-3:   #182226;
  --line:      rgba(255, 255, 255, .075);
  --line-2:    rgba(255, 255, 255, .14);
  --txt:       #e9f5ef;
  --dim:       #8ba09b;
  --dim-2:     #63746f;
  --green:     #3ee08f;
  --green-d:   #16a86a;
  --blue:      #4c8dff;
  --amber:     #ffb04f;
  --red:       #ff5f6d;
  --purple:    #a78bfa;
  --radius:    16px;
  --shadow:    0 18px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(120% 90% at 90% -10%, #0d1a16 0%, var(--bg) 55%) fixed;
  color: var(--txt);
  font-family: "UKIJ Ekran", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

[v-cloak] { display: none; }
a { color: inherit; }
button { font-family: inherit; }

.ltr, .mono, .num {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.dim  { color: var(--dim); }
.small{ font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ======================= ① كىرىش بېتى / 登录 ======================= */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(160deg, #131c20 0%, #0c1113 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 28px 26px;
  box-shadow: var(--shadow);
}
.login-logo {
  width: 60px; height: 60px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #3ee08f, #16a86a);
  box-shadow: 0 12px 30px rgba(62, 224, 143, .35);
}
.login-logo svg { width: 30px; height: 30px; }
.login-card h1 { font-size: 21px; margin: 0 0 6px; text-align: center; font-weight: 700; }
.login-sub { text-align: center; color: var(--dim); font-size: 12px; margin: 0 0 24px; letter-spacing: .4px; }
.login-card label { display: block; font-size: 12px; color: var(--dim); margin: 14px 0 7px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .35);
  color: var(--txt);
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.login-card input:focus { border-color: var(--green-d); box-shadow: 0 0 0 3px rgba(62, 224, 143, .12); }
.login-err { color: var(--red); font-size: 12px; margin: 12px 0 0; text-align: center; }
.login-tip { color: var(--dim-2); font-size: 11px; text-align: center; margin-top: 18px; line-height: 1.7; }

/* ======================= ② قۇرۇلما / 布局 ======================= */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: none;
  background: linear-gradient(180deg, #0c1214, #080c0d);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
html[dir="ltr"] .sidebar { border-left: 0; border-right: 1px solid var(--line); }

.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--line);
}
.side-brand .dot-logo {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(145deg, #3ee08f, #16a86a);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(62, 224, 143, .3);
}
.side-brand .dot-logo svg { width: 18px; height: 18px; }
.side-brand b { font-size: 15px; display: block; }
.side-brand span { font-size: 10px; color: var(--dim-2); letter-spacing: .5px; }

.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 18px; }
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--dim);
  cursor: pointer;
  font-size: 13.5px;
  transition: background .16s, color .16s;
  margin-bottom: 2px;
  position: relative;
}
.side-item:hover { background: rgba(255, 255, 255, .045); color: var(--txt); }
.side-item.on { background: rgba(62, 224, 143, .12); color: #d8ffee; }
.side-item.on::after {
  content: ""; position: absolute; top: 50%; transform: translateY(-50%);
  inset-inline-start: -10px; width: 3px; height: 16px;
  border-radius: 3px; background: var(--green);
}
.side-item .ico { width: 18px; height: 18px; flex: none; opacity: .9; }
.side-item .lb { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.side-item .lb b { font-size: 13px; font-weight: 500; white-space: nowrap; }
.side-item .lb i { font-style: normal; font-size: 9.5px; color: var(--dim-2); letter-spacing: .3px; }
.side-item.on .lb i { color: rgba(216, 255, 238, .55); }
.side-item .badge {
  margin-inline-start: auto;
  font-size: 10px; padding: 1px 6px; border-radius: 20px;
  background: rgba(255, 255, 255, .08); color: var(--dim);
}
.side-group {
  font-size: 10.5px; color: var(--dim-2);
  padding: 14px 12px 6px; letter-spacing: .6px;
}

.side-foot { border-top: 1px solid var(--line); padding: 12px 14px; }
.side-user { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.side-user .ava {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(145deg, #2b3a3f, #1a2427);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--green);
  border: 1px solid var(--line-2);
}
.side-user .who { min-width: 0; }
.side-user .who b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { font-size: 10.5px; color: var(--dim-2); }

.main { flex: 1; min-width: 0; padding: 0 26px 40px; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 0 16px;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(6, 9, 10, .96) 60%, rgba(6, 9, 10, 0));
  backdrop-filter: blur(10px);
}
.topbar h2 { font-size: 19px; margin: 0; font-weight: 700; }
.topbar .sub { font-size: 11.5px; color: var(--dim-2); margin-top: 3px; }
.topbar .grow { flex: 1; }

/* ======================= ③ كۇنۇپكا / 按钮 ======================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .045);
  color: var(--txt);
  font-size: 12.5px;
  cursor: pointer;
  transition: transform .12s, background .16s, border-color .16s;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .09); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(145deg, #3ee08f, #17a76a);
  border-color: transparent; color: #06231a; font-weight: 700;
}
.btn-primary:hover { background: linear-gradient(145deg, #4cec9b, #1cb574); }
.btn-danger { border-color: rgba(255, 95, 109, .4); color: #ffb3ba; background: rgba(255, 95, 109, .1); }
.btn-ghost { background: transparent; }
.btn-mini { padding: 5px 10px; font-size: 11.5px; border-radius: 9px; }
.btn-block { width: 100%; padding: 13px; font-size: 14px; }

/* ======================= ④ كارتىلار / 卡片 ======================= */
.card {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-h h3 { font-size: 15px; margin: 0; font-weight: 700; }
.card-h .grow { flex: 1; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
}
.stat::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3px;
  background: var(--green); opacity: .8;
}
.stat.c-blue::before  { background: var(--blue); }
.stat.c-amber::before { background: var(--amber); }
.stat.c-purple::before{ background: var(--purple); }
.stat.c-red::before   { background: var(--red); }
.stat b { display: block; font-size: 24px; letter-spacing: -.4px; }
.stat span { display: block; font-size: 11.5px; color: var(--dim); margin-top: 4px; }
.stat i { font-style: normal; font-size: 10.5px; color: var(--dim-2); display: block; margin-top: 6px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ======================= ⑤ جەدۋەل / 表格 ======================= */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  text-align: right;
  font-weight: 600;
  color: var(--dim);
  font-size: 11.5px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
html[dir="ltr"] thead th { text-align: left; }
tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:hover { background: rgba(255, 255, 255, .022); }
tbody tr:last-child td { border-bottom: 0; }
.t-right { text-align: right; }
.t-center { text-align: center; }

.u-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.u-cell .ava {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: #1b262a; border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--green); overflow: hidden;
}
.u-cell .ava img { width: 100%; height: 100%; object-fit: cover; }
.u-cell .nm { min-width: 0; }
.u-cell .nm b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.u-cell .nm span { font-size: 10.5px; color: var(--dim-2); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; padding: 2px 8px; border-radius: 20px;
  background: rgba(255, 255, 255, .07); color: var(--dim);
  white-space: nowrap;
}
.tag.on   { background: rgba(62, 224, 143, .14); color: #8df3c0; }
.tag.off  { background: rgba(255, 95, 109, .15); color: #ffa8b0; }
.tag.blue { background: rgba(76, 141, 255, .15); color: #a8c6ff; }
.tag.amber{ background: rgba(255, 176, 79, .15); color: #ffd39a; }
.tag.purple{background: rgba(167, 139, 250, .15); color: #cdbcff; }

/* ======================= ⑥ كىرگۈزۈش / 输入 ======================= */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11.5px; color: var(--dim); }
input[type="text"], input[type="number"], input[type="search"], input[type="password"], select, textarea {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .3);
  color: var(--txt);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--green-d);
  box-shadow: 0 0 0 3px rgba(62, 224, 143, .1);
}
select { cursor: pointer; }
textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .field { min-width: 150px; }
.toolbar .grow { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 38px; height: 21px; border-radius: 20px;
  background: rgba(255, 255, 255, .12); position: relative; transition: background .18s;
  flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 15px; height: 15px; border-radius: 50%; background: #fff;
  transition: transform .18s;
}
.switch input:checked + .track { background: var(--green-d); }
.switch input:checked + .track::after { transform: translateX(17px); }
html[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-17px); }

/* ======================= ⑦ بەت ئايرىش / 分页 ======================= */
.pager {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
  padding-top: 14px; font-size: 12px; color: var(--dim);
}
.pager .grow { flex: 1; }

/* ======================= ⑧ گرافىك / 图表 ======================= */
.chart { width: 100%; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 148px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.bar-stack { width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; }
.bar {
  width: 45%; max-width: 14px; min-height: 3px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #4cec9b, #1a8f5e);
  transition: height .4s ease;
}
.bar.b2 { background: linear-gradient(180deg, #6fa6ff, #2e63cf); }
.bar-col .lab { font-size: 9.5px; color: var(--dim-2); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--dim); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-inline-end: 5px; }

/* ======================= ⑨ ئۇقتۇرۇش / Toast ======================= */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%);
  background: #16221f; border: 1px solid rgba(62, 224, 143, .35);
  color: #d8ffee; padding: 11px 20px; border-radius: 12px;
  font-size: 12.5px; z-index: 999; box-shadow: var(--shadow);
}
.toast.err { border-color: rgba(255, 95, 109, .45); color: #ffc4c9; background: #241417; }

/* ======================= ⑩ مودال / Modal ======================= */
.mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .62);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 900; backdrop-filter: blur(3px);
}
.modal {
  width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto;
  background: linear-gradient(160deg, #162024, #0d1214);
  border: 1px solid var(--line-2); border-radius: 18px;
  padding: 22px; box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 4px; font-size: 16px; }
.modal .m-sub { color: var(--dim); font-size: 11.5px; margin-bottom: 16px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ======================= ⑪ ھەر خىل ======================= */
.empty { text-align: center; color: var(--dim-2); padding: 40px 10px; font-size: 12.5px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; font-size: 12.5px; margin: 0; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; }
.settings-block + .settings-block { margin-top: 14px; }
.set-row {
  display: grid; grid-template-columns: 1fr 260px; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: 0; }
.set-row .lbl b { display: block; font-size: 12.5px; font-weight: 600; }
.set-row .lbl span { font-size: 10.5px; color: var(--dim-2); }
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--green);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.save-bar {
  position: sticky; bottom: 0; z-index: 8;
  margin-top: 16px;
  padding: 16px 0 18px;
  display: flex; justify-content: flex-start;
  background: linear-gradient(0deg, #06090a 62%, rgba(6, 9, 10, 0));
}

/* ---- زاپاسلاش / 备份上传 ---- */
.file-in {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(62, 224, 143, .35);
  background: rgba(62, 224, 143, .05);
  color: var(--dim);
  font-size: 12px;
  cursor: pointer;
}
.file-in::file-selector-button {
  margin-inline-end: 10px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: #16202a;
  color: var(--txt);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.err-text { color: #ffa8b0; }

/* ======================= ⑫ تېلېفون / 手机屏 ======================= */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: static; width: 100%; height: auto; flex-direction: column;
    border-left: 0; border-bottom: 1px solid var(--line);
  }
  .side-nav { display: flex; overflow-x: auto; gap: 6px; padding: 8px 10px; }
  .side-item { margin: 0; white-space: nowrap; }
  .side-item.on::after { display: none; }
  .side-group { display: none; }
  .side-foot { display: flex; align-items: center; gap: 10px; border-top: 0; }
  .side-user { margin: 0; flex: 1; }
  .main { padding: 0 14px 30px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  /* تېلېفوندا ماۋزۇ ئۇزۇن بولسا ئاستىغا چۈشسۇن / 标题过长自动换行 */
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar > div:first-child { min-width: 0; flex: 1 1 100%; }
  .topbar h2 { font-size: 16px; line-height: 1.4; }

  /* جەدۋەل قىسىلمىسۇن — كارتا ئىچىدە يانغا سىيرىلسۇن */
  table { min-width: 620px; }
  .table-wrap { margin: 0; padding-bottom: 4px; }
  tbody td .btn + .btn { margin-inline-start: 4px; }
  tbody td .btn { margin-bottom: 4px; white-space: nowrap; }
  .set-row { grid-template-columns: 1fr; }
}
