/* ============================================================
   admin.css — باشقۇرۇش سۇپىسى
   ============================================================ */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --side: #151a26;
  --ink: #1b2130;
  --dim: #6d7686;
  --line: #e4e8f0;
  --brand: #d9a441;
  --brand-d: #b9812a;
  --ok: #16a34a;
  --bad: #dc2626;
  --warn: #d97706;
  --blue: #2563eb;
  --radius: 12px;
  --shadow: 0 8px 24px -14px rgba(20, 30, 60, .35);
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'UKIJ Tuz Tom', 'Noto Sans Arabic', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.5; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; direction: ltr; }

/* ---------------- قۇرۇلما ---------------- */
.adm { display: flex; min-height: 100vh; }
.adm-side {
  width: 218px; flex: 0 0 218px;
  background: linear-gradient(180deg, #151a26, #10141e);
  color: #c7cfdd; display: flex; flex-direction: column;
  padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.adm-logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font-size: 19px; background: linear-gradient(135deg, var(--brand), var(--brand-d));
}
.adm-brand b { display: block; color: #fff; font-size: 14px; }
.adm-brand small { color: #7d879b; font-size: 10.5px; letter-spacing: .5px; }
.adm-nav { display: grid; gap: 2px; overflow-y: auto; flex: 1; }
.adm-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  color: #b8c2d4; font-size: 13px; text-decoration: none;
  transition: .16s;
}
.adm-nav a i { font-style: normal; font-size: 15px; width: 20px; text-align: center; opacity: .9; }
.adm-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.adm-nav a.is-on { background: rgba(217,164,65,.16); color: #f0cf92; font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.adm-side-foot { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.adm-side-foot a { color: #8e99ad; font-size: 12px; padding: 4px 8px; }
.adm-side-foot a.danger { color: #e08a86; }

.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 24px; background: #fff;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.adm-title { font-size: 17px; font-weight: 700; }
.adm-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); }
.adm-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-d)); color: #241a05; font-weight: 700;
}
.adm-body { flex: 1; padding: 22px 24px 40px; }
.adm-foot { padding: 14px 24px; color: #97a0b0; font-size: 11.5px; border-top: 1px solid var(--line); }

.adm-flash {
  padding: 11px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13px;
  background: #eafaf0; border: 1px solid #bdeccd; color: #10743a;
}
.adm-flash.err { background: #fff1f1; border-color: #fbd0d0; color: #b01c1c; }

/* ---------------- كۇنۇپكا ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-family: inherit; font-size: 13px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: .16s;
}
.btn:hover { background: #f5f7fb; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, #e2b258, #c98f2c); border: 0; color: #241a05; font-weight: 700; }
.btn-primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, #e2b258, #c98f2c); }
.btn-danger { background: #fff; border-color: #f3c7c7; color: #b01c1c; }
.btn-danger:hover { background: #fff3f3; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------- ستاتىستىكا ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.stat-card span { color: var(--dim); font-size: 12px; }
.stat-card b { font-size: 24px; line-height: 1.3; }
.stat-card i { font-style: normal; font-size: 11.5px; color: var(--ok); }
.stat-card.accent { background: linear-gradient(135deg, #1c2333, #10151f); color: #fff; border: 0; }
.stat-card.accent span { color: #9aa6bb; }
.stat-card.accent b { color: #f2d192; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.panel-head h2 { font-size: 15px; }
.panel-head .sub { color: var(--dim); font-size: 12px; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }

/* ---------------- جەدۋەل ---------------- */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th, table.tb td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tb th { background: #fafbfe; color: var(--dim); font-weight: 500; font-size: 12px; white-space: nowrap; }
table.tb tr:hover td { background: #fcfdff; }
table.tb td .thumb { width: 40px; height: 56px; object-fit: cover; border-radius: 6px; display: block; }
table.tb .cell-title b { display: block; }
table.tb .cell-title small { color: var(--dim); font-size: 11px; }
table.tb .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; background: #eef1f7; color: #56627a;
}
.badge.ok { background: #e8f8ee; color: #10743a; }
.badge.bad { background: #fdeeee; color: #b01c1c; }
.badge.vip { background: #fdf3dd; color: #8a5d0d; }
.badge.blue { background: #e9f0fe; color: #1f4fd0; }

/* ---------------- فورمىلا ---------------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; color: #495366; margin-bottom: 5px; }
.field > label .req { color: var(--bad); }
.field input[type=text], .field input[type=number], .field input[type=password],
.field input[type=url], .field input[type=tel], .field input[type=email],
.field input[type=file], .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 13.5px; background: #fbfcfe; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(217,164,65,.35); border-color: var(--brand); background: #fff;
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.9; }
.field .hint { display: block; color: #98a0ae; font-size: 11.5px; margin-top: 4px; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.inline input[type=checkbox] { width: auto; }
.img-preview { margin-bottom: 8px; }
.img-preview img { max-width: 130px; max-height: 170px; border-radius: 8px; border: 1px solid var(--line); }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------------- تەب ---------------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: #eef1f7; border-radius: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 15px; border-radius: 8px; color: #5b6579; font-size: 13px; text-decoration: none; }
.tabs a.is-on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 2px 8px rgba(20,30,60,.08); }

/* ---------------- ئۇسلۇب تاللاش ---------------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.theme-card {
  border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: #fff; cursor: pointer; transition: .18s; position: relative; display: block;
  text-decoration: none; color: var(--ink);
}
.theme-card:hover { border-color: #c9d2e4; transform: translateY(-2px); text-decoration: none; }
.theme-card.is-on { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(217,164,65,.15); }
.theme-card.is-on::after {
  content: '✓ تاللاندى'; position: absolute; inset-block-start: 10px; inset-inline-start: 10px;
  background: var(--brand); color: #241a05; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
}
.theme-thumb { height: 126px; background-size: cover; background-position: top center; position: relative; }
.theme-thumb.web1 { background: linear-gradient(140deg, #0b0d13 0%, #1a2030 55%, #6b4a17 100%); }
.theme-thumb.web2 { background: linear-gradient(140deg, #fdf9ef 0%, #ece3d1 55%, #12616d 100%); }
.theme-thumb.m1 { background: linear-gradient(160deg, #07080d 0%, #1a1f2e 60%, #7a5416 100%); }
.theme-thumb.m2 { background: linear-gradient(160deg, #f7fafc 0%, #dbe7f5 60%, #0d8bd9 100%); }
.theme-thumb span {
  position: absolute; inset-block-end: 10px; inset-inline-start: 12px;
  color: #fff; font-size: 11.5px; text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.theme-thumb.light span { color: #22303f; text-shadow: none; }
.theme-body { padding: 12px 14px; }
.theme-body b { display: block; font-size: 13.5px; }
.theme-body small { color: var(--dim); font-size: 11.5px; }

.preview-frame {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #fff; direction: ltr;
}
.preview-frame iframe { display: block; width: 100%; border: 0; background: #fff; }
.preview-frame.desktop iframe { height: 460px; }
.preview-frame.mobile { max-width: 390px; margin: 0 auto; }
.preview-frame.mobile iframe { height: 620px; }

/* ---------------- كىرىش ---------------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(900px 500px at 75% -10%, #26314b 0%, #0d111a 55%), #0d111a;
  padding: 24px;
}
.login-box {
  width: 100%; max-width: 380px; background: #fff; border-radius: 18px;
  padding: 30px 28px; box-shadow: 0 30px 70px rgba(0,0,0,.45);
}
.login-logo { font-size: 34px; text-align: center; margin-bottom: 6px; }
.login-box h1 { font-size: 18px; text-align: center; margin-bottom: 4px; }
.login-box p.sub { text-align: center; color: var(--dim); font-size: 12.5px; margin: 0 0 20px; }
.login-box .field input { background: #f8fafd; }
.login-hint { text-align: center; font-size: 11.5px; color: #9aa2b1; margin-top: 14px; }

/* ---------------- ئۇچۇر ---------------- */
.empty { padding: 40px 20px; text-align: center; color: var(--dim); font-size: 13px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.pager { display: flex; gap: 6px; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 32px; height: 32px; padding: 0 10px; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 12.5px; text-decoration: none;
}
.pager a.is-on { background: var(--brand); border-color: var(--brand); color: #241a05; font-weight: 700; }

.hr { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ---------------- ماسلىشىش ---------------- */
@media (max-width: 980px) {
  .adm-side { width: 70px; flex: 0 0 70px; padding: 14px 8px; }
  .adm-brand span:last-child, .adm-nav a span, .adm-side-foot { display: none; }
  .adm-nav a { justify-content: center; padding: 11px 0; }
  .adm-nav a i { font-size: 17px; }
  .adm-body { padding: 16px; }
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .adm { display: block; }
  .adm-side {
    width: 100%; height: auto; position: static; flex-direction: row;
    align-items: center; padding: 8px 10px; gap: 8px;
  }
  .adm-brand { padding: 0; }
  .adm-brand span:last-child { display: block; }
  .adm-nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; }
  .adm-nav a { padding: 8px 10px; }
  .adm-nav a span { display: none; }
  .adm-top { padding: 10px 14px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .adm-title { font-size: 15px; }
  .adm-body { padding: 12px; }
}
