/* Admin panel — site.css ustiga qo'shimcha */
body.admin { flex-direction: row; background: #f2f5fa; }

.sidebar {
  position: sticky; top: 0; height: 100vh; width: 240px; flex: none;
  background: var(--navy); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 20px;
}
.sidebar .brand { color: #fff; padding: 0 6px; }
.sidebar .brand small { color: #9fb6e0; display: block; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { color: #c9d7f2; padding: 11px 12px; border-radius: 10px; font-weight: 700; font-size: 14.5px; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar nav a.active { background: var(--blue); color: #fff; }
.logout { margin-top: auto; padding: 0 6px; }
.logout .muted { color: #9fb6e0; }

.admin-main { flex: 1; min-width: 0; padding: 24px 28px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 900; }
.page-head h1 .muted { font-weight: 600; font-size: 18px; }
.admin .filters { grid-template-columns: 1fr 220px 200px auto; }
.admin .filters.simple { grid-template-columns: 1fr auto; }
.stats .card, .dash-grid .card, .product-form .card { margin-top: 0; }

/* Statistika */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { padding: 18px; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.stat span { color: var(--muted); font-weight: 700; font-size: 13px; }
.stat b { font-size: 24px; font-weight: 900; color: var(--navy); }
.stat small { color: var(--muted); font-weight: 600; }
.stat.accent { background: var(--blue); }
.stat.accent span, .stat.accent b, .stat.accent small { color: #fff; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dash-grid .wide { grid-column: 1 / -1; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding-top: 10px; }
.chart .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.chart .bar-v { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--sky), var(--blue)); }
.chart .val { font-size: 11px; font-weight: 800; color: var(--navy); }
.chart .lbl { font-size: 11px; color: var(--muted); font-weight: 700; text-align: center; line-height: 1.25; }

/* Jadval */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th a { color: inherit; }
.table th a:hover { color: var(--blue); }
.table td { padding: 10px 14px; border-bottom: 1px solid #eef2f8; vertical-align: middle; }
.table tbody tr:hover { background: #f7faff; }
.table .num { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 700; border: 0; padding-top: 6px; padding-bottom: 6px; }
.table tfoot .grand td { font-size: 17px; font-weight: 900; color: var(--navy); }
.table .dim td { opacity: .55; }
.row-link { cursor: pointer; }
.thumb { width: 44px; height: 44px; min-width: 44px; max-width: none; border-radius: 10px; object-fit: cover; }
.table td:first-child a { white-space: nowrap; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.switch { border: 0; border-radius: 99px; padding: 4px 12px; font-size: 12px; font-weight: 800; cursor: pointer; background: #e8edf5; color: var(--muted); }
.switch.on { background: #e3f6ec; color: #0d6b3a; }
.status.big { font-size: 14px; padding: 6px 14px; }

/* Forma */
.product-form { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.img-drop { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 14px; display: grid; place-items: center; overflow: hidden; margin: 8px 0 10px; background: var(--card-2); }
.img-drop img { width: 100%; height: 100%; object-fit: cover; }
.status-form { display: grid; gap: 8px; }
.status-form .option > span { padding: 10px 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0 0 8px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; word-break: break-word; }

/* Kirish */
.login-wrap { min-height: 80vh; display: grid; place-items: center; }
.login { width: 100%; max-width: 380px; text-align: center; }
.login img { margin: 0 auto 10px; }
.login .field { text-align: left; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body.admin { flex-direction: column; }
  .sidebar { position: static; height: auto; width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; gap: 10px; }
  .sidebar nav { display: flex; flex-wrap: wrap; flex: 1 1 100%; order: 3; }
  .sidebar nav a { padding: 8px 10px; font-size: 13px; }
  .logout { margin: 0 0 0 auto; display: flex; gap: 8px; align-items: center; }
  .logout .btn.block { width: auto; margin: 0; min-height: 36px; }
  .admin-main { padding: 16px; }
  .admin .filters { grid-template-columns: 1fr 1fr; }
  .admin .filters input[type=search] { grid-column: 1 / -1; }
  .product-form { grid-template-columns: 1fr; }
}
