/* @rozgor-part 2/10 — RO'YXATLAR: nomli ro'yxat selektori, ochiladigan menyu, ro'yxat qatori
   BO'LINDI (5d-blok): ilgari bitta `style.css` (3058 qator) edi. TARTIB MUHIM —
   keyingi qoida oldingisini bosadi, shuning uchun public/index.html dagi <link>
   teglari AYNAN shu raqamlar tartibida turishi SHART. */
/* --- Ro'yxatlar (nomli ro'yxatlar) selektori ------------------------------ */

/* "Yangi ro'yxat" / "Qayta nomlash" formasi — topbar ichida, sarlavha qatori
   ostida (main'ning yon to'ldirmasidan tashqarida), shuning uchun yon
   to'ldirmani o'zi beradi. Standart YASHIRIN — menyudagi "➕ Yangi ro'yxat"
   yoki "⋮ -> ✏️ Nomini o'zgartirish" ochadi. */
.lists-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 8px;
}

/* Ro'yxat selektori — dropdown tugma + ochiladigan menyu (mobil-birinchi).
   Sarlavha qatorida keng joy egallaydi (o'ngda "👥" qoladi). */
.list-dd {
  position: relative;
  flex: 1;
  min-width: 0;
}

.list-dd-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid rgba(128, 128, 128, 0.25);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--tg-secondary-bg);
  color: var(--tg-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
}

.list-dd-btn:active {
  opacity: 0.8;
}

.list-dd-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

/* Ro'yxat sarlavhasi 1-qatori (oy + yil, yoki oysiz to'liq nom) — bitta qator,
   sig'masa ellipsis. Selektor va dropdown bandi uchun bir xil (0007 E-qism). */
.list-line1 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 2-qator (erkin nom) — xira; 2 QATORGACHA o'raladi (to'liq ko'rinadi), undan
   uzun bo'lsa ellipsis bilan kesiladi ("doim to'liq" — B tanlov). */
.list-line2 {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--tg-hint);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.list-dd-chevron {
  flex: none;
  color: var(--tg-hint);
  font-size: 12px;
  transition: transform 0.15s ease;
}

.list-dd.open .list-dd-chevron {
  transform: rotate(180deg);
}

/* Ochiladigan menyu — tugma ostida ustma-ust (absolute), skrollanadi */
.list-dd-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--tg-bg);
  border: 1px solid rgba(128, 128, 128, 0.2);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.list-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: var(--tg-text);
  font-size: 15px;
  line-height: 1.25;
  cursor: pointer;
  text-align: left;
}

.list-dd-item:active {
  background: var(--tg-secondary-bg);
}

.list-dd-item.active {
  background: rgba(36, 129, 204, 0.12);
}

.list-dd-check {
  flex: none;
  width: 18px;
  color: var(--tg-link);
  font-size: 14px;
  text-align: center;
}

.list-dd-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

.list-dd-count {
  flex: none;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.2);
  color: var(--tg-hint);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* "➕ Yangi ro'yxat" menyu bandi — ro'yxatlardan ajratib turadi */
.list-dd-new {
  margin-top: 4px;
  border-top: 1px solid rgba(128, 128, 128, 0.18);
  padding-top: 12px;
  color: var(--tg-link);
  font-weight: 600;
}

/* Ro'yxat qatori (0014): sarlavha + "⋮" amallar tugmasi bir qatorda; amallar
   paneli (rename/archive/delete) shu qator ostida ochiladi. */
.list-dd-row {
  display: flex;
  flex-direction: column;
}
.list-dd-rowtop {
  display: flex;
  align-items: center;
  gap: 2px;
}
.list-dd-rowtop .list-dd-item {
  flex: 1;
  min-width: 0;
  width: auto;
}
.list-dd-kebab {
  flex: none;
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  color: var(--tg-hint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.list-dd-kebab:active {
  background: var(--tg-secondary-bg);
}

/* ⋮ amallar paneli — sarlavha ostida, chapdan bir oz chetlangan (ierarxiya) */
.list-dd-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 4px 6px 30px;
}
.list-dd-action {
  display: block;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  background: transparent;
  color: var(--tg-text);
  font-size: 14px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.list-dd-action:active {
  background: var(--tg-secondary-bg);
}
.list-dd-action.danger {
  color: var(--danger);
}

/* "Arxivlanganlar" bo'limi sarlavhasi + qatorlari (0014) */
.list-dd-arch-head {
  margin-top: 6px;
  padding: 8px 12px 4px;
  border-top: 1px solid rgba(128, 128, 128, 0.18);
  color: var(--tg-hint);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.list-dd-arch-row {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
}
.list-dd-arch-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--tg-hint);
  font-size: 14px;
}
.list-dd-unarchive {
  flex: none;
  width: auto;
  padding: 6px 10px;
  color: var(--tg-link);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

