/* Codeva panellari → maisa brandbook (2026-10-30).
   maisa-tokens.css → maisa-auto-dark.css → maisa-panel.css dan KEYIN yuklanadi.
   Faqat tokenlar: rang/oʻlcham/shrift brandbookdan. Bu fayl brandbookda yoʻq kichik bloklarni (modal, toast, switch,
   chat, matn maydoni) va eski sinflarni tokenlarga bogʻlaydi. */
html { background: rgb(var(--mx-bg)); }
body.mx { font-family: var(--mx-font); }
.mx textarea, .mx input, .mx select, .mx button { font-family: inherit; }
.mx-topbar__title { flex: 1; min-width: 0; }
.mx-topbar .mx-btn { flex: none; }

/* sidebar brendi: logo (SVG) + nom */
.mx-sidebar__logo { border-radius: 10px; }
.mx-nav__badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--mx-r-pill); display: inline-grid; place-items: center;
  background: var(--mx-err-bg); color: var(--mx-err); border: 1px solid var(--mx-err-bd); font: 700 10.5px var(--mx-font-num); }
.mx-nav__item.is-active .mx-nav__badge + * { display: none; }
button.mx-nav__item { width: 100%; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.mx-sidebar__foot .mx-btn { width: 100%; }

/* kichik yordamchi sinflar */
.cv-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 11.5px var(--mx-font-num); color: rgb(var(--mx-faint)); }
.cv-title { font-size: 14px; font-weight: 700; word-break: break-word; }
.cv-h2 { font-size: var(--mx-fs-h2); font-weight: 700; margin-bottom: 6px; }
.cv-dh { margin: 14px 0 6px; font: 800 var(--mx-fs-micro)/14px var(--mx-font); letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--mx-faint)); }
.cv-dp { margin-top: 8px; line-height: 1.65; color: rgb(var(--mx-muted)); white-space: pre-wrap; word-break: break-word; }
.cv-icotext { display: inline-flex; align-items: center; gap: 4px; }
.cv-icotext .mx-ico { width: 14px; height: 14px; }
.cv-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.cv-btn--ok { background: var(--mx-ok-bg); border-color: var(--mx-ok-bd); color: var(--mx-ok); }
.cv-btn--ok:hover { background: var(--mx-ok-bg); filter: brightness(.96); }
.cv-iconbtn { cursor: pointer; padding: 0; }
.cv-img { width: 100%; border-radius: var(--mx-r-md); border: 1px solid rgb(var(--mx-border)); display: block; }
.cv-video { width: 100%; max-height: 380px; border-radius: var(--mx-r-md); background: rgb(var(--mx-overlay)); margin-bottom: 12px; }
.cv-list { display: flex; flex-direction: column; gap: 8px; }
.cv-list__row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid rgb(var(--mx-border)); border-radius: var(--mx-r-sm); background: rgb(var(--mx-subtle) / .5); }
.cv-quick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; margin-bottom: 8px; border: 1px solid rgb(var(--mx-border)); border-radius: var(--mx-r-lg);
  background: rgb(var(--mx-surface)); color: inherit; font: inherit; cursor: pointer; }
.cv-quick:hover { background: rgb(var(--mx-subtle)); }
.cv-feed { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: 12.5px; }
.cv-feed__dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 9px; flex: none; background: var(--mx-info); }
.cv-feed__dot.is-ok { background: var(--mx-ok); } .cv-feed__dot.is-wait { background: var(--mx-wait); } .cv-feed__dot.is-err { background: var(--mx-err); }

/* matn maydoni (.mx-input ichida) */
.cv-textarea { height: auto; align-items: stretch; padding: 8px 12px; color: rgb(var(--mx-ink)); width: 100%; }
.cv-textarea textarea { width: 100%; border: 0; outline: 0; background: transparent; color: rgb(var(--mx-ink)); font: inherit; resize: vertical; min-height: 44px; }

/* bo'sh / xato / yuklanish */
.cv-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 24px; text-align: center; }
.cv-empty__ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--mx-r-md); background: rgb(var(--mx-subtle)); color: rgb(var(--mx-faint)); border: 1px solid rgb(var(--mx-border)); }
.cv-empty__ico.is-err { background: var(--mx-err-bg); color: var(--mx-err); border-color: var(--mx-err-bd); }
.cv-empty__title { font-weight: 700; font-size: 14px; }
.cv-loading { display: flex; flex-direction: column; gap: 12px; padding: 24px; }

/* ustunli diagramma */
.cv-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; }
.cv-bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.cv-bars__bar { width: 100%; border-radius: 6px 6px 0 0; background: var(--mx-ac-fill); }
.cv-bars__val, .cv-bars__lbl { font: 500 11px var(--mx-font-num); color: rgb(var(--mx-faint)); white-space: nowrap; }

/* modal */
.cv-modal { position: fixed; inset: 0; z-index: var(--mx-z-modal); display: grid; place-items: center; padding: 24px; background: rgb(var(--mx-overlay) / .55); }
.cv-modal__box { width: 100%; max-width: 520px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; background: rgb(var(--mx-surface)); border: 1px solid rgb(var(--mx-border)); border-radius: var(--mx-r-xl); box-shadow: var(--mx-shadow-pop); }
.cv-modal__box.is-wide { max-width: 760px; }
.cv-modal__head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid rgb(var(--mx-border)); }
.cv-modal__title { margin: 0; flex: 1; font-size: var(--mx-fs-h2); font-weight: 700; }
.cv-modal__body { padding: var(--mx-card-p); overflow-y: auto; flex: 1; }
.cv-modal__foot { padding: 12px 16px; border-top: 1px solid rgb(var(--mx-border)); display: flex; flex-direction: column; gap: 10px; }

/* toast */
.cv-toasts { position: fixed; right: 20px; bottom: 20px; z-index: var(--mx-z-toast); display: flex; flex-direction: column; gap: 8px; }
.cv-toast { max-width: 360px; padding: 10px 14px; border-radius: var(--mx-r-sm); border: 1px solid; font-weight: 600; font-size: 12.5px; box-shadow: var(--mx-shadow-pop); background: rgb(var(--mx-surface)); }
.cv-toast--ok { color: var(--mx-ok); border-color: var(--mx-ok-bd); }
.cv-toast--err { color: var(--mx-err); border-color: var(--mx-err-bd); }
.cv-toast--info { color: var(--mx-info); border-color: var(--mx-info-bd); }

/* switch */
.cv-switch { position: relative; width: 42px; height: 24px; flex: none; border: 1px solid rgb(var(--mx-control)); border-radius: var(--mx-r-pill); background: rgb(var(--mx-subtle)); cursor: pointer; padding: 0; }
.cv-switch i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgb(var(--mx-control)); transition: left var(--mx-t-fast) var(--mx-ease), background var(--mx-t-fast); }
.cv-switch.is-on { background: var(--mx-ok-bg); border-color: var(--mx-ok); }
.cv-switch.is-on i { left: 20px; background: var(--mx-ok); }

/* chat */
.cv-chat { display: flex; gap: var(--mx-gap); height: calc(100vh - 220px); min-height: 440px; }
.cv-chat__list { width: 240px; flex: none; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.cv-chat__item { text-align: left; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: var(--mx-r-sm); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.cv-chat__item:hover { background: rgb(var(--mx-subtle)); }
.cv-chat__item.is-active { background: var(--mx-ac-soft); border-color: var(--mx-ac-line); }
.cv-chat__pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cv-chat__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid rgb(var(--mx-border)); }
.cv-chat__body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.cv-chat__send { padding: 10px 12px; border-top: 1px solid rgb(var(--mx-border)); display: flex; gap: 8px; }
.cv-bubble { max-width: 70%; align-self: flex-start; padding: 10px 14px; border-radius: 4px 14px 14px 14px; background: rgb(var(--mx-subtle)); }
.cv-bubble.is-me { align-self: flex-end; border-radius: 14px 4px 14px 14px; background: var(--mx-ac-fill); color: var(--mx-ac-on); }
.cv-bubble__time { margin-top: 4px; text-align: right; font-size: 10px; opacity: .7; }
@media (max-width: 767px) { .cv-chat { flex-direction: column; height: auto; } .cv-chat__list { width: 100%; max-height: 180px; } .cv-chat__pane { min-height: 420px; } .cv-toasts { left: 16px; right: 16px; } }

/* login (.mx-auth) kichik qo'shimchalar */
.cv-auth-brand { display: flex; align-items: center; gap: 12px; }
.cv-auth-brand img { width: 44px; height: 44px; border-radius: 12px; }
.cv-auth-title { font: 700 34px/1.15 var(--mx-font); letter-spacing: -.02em; max-width: 420px; }
.cv-auth-note { color: rgb(var(--mx-faint)); font-size: 11.5px; text-align: center; margin: 0; }
.mx-auth__side .cv-auth-sub { opacity: .72; max-width: 420px; margin: 12px 0 0; }
.cv-alert { padding: 10px 12px; border-radius: var(--mx-r-sm); border: 1px solid var(--mx-err-bd); background: var(--mx-err-bg); color: var(--mx-err); font-size: 12.5px; font-weight: 600; }

/* sahifa (pedagog) yordamchilari */
.cv-pagehead-sub { margin: 6px 0 0; color: rgb(var(--mx-muted)); font-size: 12.5px; }
.mx-page { max-width: var(--mx-content-max); }
.cv-alert.is-ok { background: var(--mx-ok-bg); border-color: var(--mx-ok-bd); color: var(--mx-ok); }

/* kirish maydoni: tashqi ramka fokusni ko'rsatadi, ichki outline ikkilanmasin */
.mx-input:focus-within { border-color: var(--mx-ac-fill); }
.mx-input input:focus-visible, .mx-input textarea:focus-visible { outline: none; }
