@font-face { font-family: 'Plus Jakarta Sans'; src: url('/assets/fonts/PlusJakartaSans.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }
:root { --brand: #5151FF; --brand2: #4141E0; --tint: #EEEEFF; --bg: #F4F5FA; --card: #fff; --line: #E4E6F0; --tx: #171A2B; --tx2: #454B63; --mut: #737A93; --ok: #12A150; --warn: #C27400; --bad: #D92D20; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; background: var(--bg); color: var(--tx); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 17px; font-weight: 800; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 800; margin: 0 0 8px; }
.boot { padding: 60px; text-align: center; color: var(--mut); }

/* Kirish */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(90% 60% at 50% 0%, #E4E4FF 0%, #F4F5FA 70%); }
.auth-card { width: 100%; max-width: 410px; background: var(--card); border-radius: 24px; padding: 30px 26px; box-shadow: 0 24px 60px rgba(40,40,120,0.14); }
.auth-card img { height: 34px; display: block; margin-bottom: 18px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card p { margin: 0 0 16px; color: var(--mut); font-size: 14px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 14px; font-weight: 600; }
.auth-links a { cursor: pointer; }

/* Asos */
.layout { display: flex; min-height: 100vh; }
.side { width: 244px; flex: none; background: var(--card); border-right: 1px solid var(--line); padding: 16px 12px 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { height: 30px; margin: 4px 10px 16px; display: block; }
.side h4 { margin: 16px 12px 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); font-weight: 800; }
.side a.nav { display: block; padding: 9px 12px; border-radius: 10px; color: var(--tx2); text-decoration: none; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.side a.nav:hover { background: var(--bg); }
.side a.nav.on { background: var(--tint); color: var(--brand); font-weight: 800; }
.main { flex: 1; min-width: 0; padding: 22px 28px 60px; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.top .sp { flex: 1; }
.burger { display: none; border: 1px solid var(--line); background: var(--card); border-radius: 10px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.hint { font-size: 13px; color: var(--mut); margin: 4px 0 0; }
.note { padding: 11px 14px; border-radius: 12px; background: var(--tint); color: #33338F; font-size: 14px; margin-bottom: 14px; }
.note.warn { background: #FFF4DC; color: #7A5410; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat span { font-size: 13px; color: var(--mut); font-weight: 600; }

/* Forma */
label.f { display: block; margin-bottom: 12px; }
label.f > span, .flabel { display: block; font-size: 13px; font-weight: 700; color: var(--tx2); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=datetime-local], input[type=date], select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--tx); font: inherit; }
input:focus, select:focus, textarea:focus, .rich:focus { outline: 2px solid rgba(81,81,255,0.35); border-color: var(--brand); }
textarea { min-height: 84px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 8px; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--brand2); color: #fff; }
.btn.ghost { background: #fff; color: var(--tx2); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); color: var(--tx); }
.btn.danger { background: #fff; color: var(--bad); border-color: #F5C6C2; }
.btn.danger:hover { background: #FEECEA; color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.err { color: var(--bad); font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 160px; }

/* Jadval */
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; font-weight: 800; color: var(--mut); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--tx2); white-space: nowrap; }
.pill.ok { background: #E3F7EC; color: #0B7A3B; }
.pill.warn { background: #FFF4DC; color: #8A5A00; }
.pill.bad { background: #FEECEA; color: #B42318; }
.pill.brand { background: var(--tint); color: var(--brand); }
code { background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; }

/* Muharrir */
.editor-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: #FAFAFD; position: sticky; top: 0; z-index: 3; }
.toolbar button { min-width: 34px; height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--tx2); cursor: pointer; }
.toolbar button:hover { background: var(--tint); color: var(--brand); }
.toolbar button.on { background: var(--brand); color: #fff; }
.rich { min-height: 340px; padding: 16px; border: 1px solid var(--line); border-radius: 0 0 12px 12px; background: #fff; line-height: 1.65; overflow-x: auto; }
.rich h2 { font-size: 22px; margin: 18px 0 8px; } .rich h3 { font-size: 18px; margin: 14px 0 6px; } .rich h4 { font-size: 16px; margin: 12px 0 6px; }
.rich img { max-width: 100%; height: auto; border-radius: 10px; }
.rich blockquote { border-left: 3px solid var(--brand); margin: 12px 0; padding: 6px 14px; color: var(--tx2); }
.rich table { border-collapse: collapse; width: 100%; } .rich td, .rich th { border: 1px solid var(--line); padding: 6px 8px; }
.rich pre { background: var(--bg); padding: 10px; border-radius: 8px; overflow-x: auto; }
.rich iframe { width: 100%; aspect-ratio: 16/9; border: 0; }
.rich.small { min-height: 110px; }
.htmlbox { width: 100%; min-height: 340px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; border-radius: 0 0 12px 12px; }
.check-list { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.check-list li { padding: 5px 0 5px 22px; position: relative; color: var(--tx2); }
.check-list li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.check-list li.w::before { content: '!'; color: var(--warn); }
.serp { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-family: arial, sans-serif; }
.serp i { display: block; font-style: normal; font-size: 12.5px; color: #4d5156; }
.serp b { display: block; font-size: 18px; font-weight: 400; color: #1a0dab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp span { font-size: 13.5px; color: #4d5156; }
.count { float: right; font-weight: 700; color: var(--mut); } .count.over { color: var(--bad); }
.imgfield { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.imgfield img { width: 72px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.subitem { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #FBFBFE; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; font-weight: 700; font-size: 14px; color: var(--mut); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.bar-row { display: grid; grid-template-columns: 90px 1fr 50px; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.bar-row div { height: 10px; border-radius: 99px; background: var(--tint); overflow: hidden; }
.bar-row i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* Oynalar */
.modal-bg { position: fixed; inset: 0; background: rgba(20,22,50,0.5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 30px 14px; overflow-y: auto; }
.modal { background: var(--card); border-radius: 18px; padding: 20px; width: 100%; max-width: 620px; box-shadow: 0 30px 70px rgba(0,0,0,0.3); }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.media-cell { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; cursor: pointer; font-size: 12px; display: flex; flex-direction: column; }
.media-cell:hover { border-color: var(--brand); }
.media-cell img { width: 100%; height: 96px; object-fit: cover; display: block; background: var(--bg); }
.media-cell div { padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--tx); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; z-index: 90; max-width: 90vw; box-shadow: 0 12px 30px rgba(0,0,0,0.3); }
#toast.bad { background: var(--bad); }
.backdrop { display: none; }

@media (max-width: 1020px) { .editor-wrap { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .side { position: fixed; left: -270px; z-index: 40; width: 250px; transition: left .2s ease; box-shadow: 0 0 40px rgba(0,0,0,0.2); }
  .side.open { left: 0; }
  .backdrop.open { display: block; position: fixed; inset: 0; background: rgba(20,22,50,0.35); z-index: 39; }
  .burger { display: inline-flex; align-items: center; justify-content: center; }
  .main { padding: 14px 14px 50px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 21px; }
}
