/* assets/css/ux.css — foydalanish qulayligi komponentlari (docs/FOYDALANISH_QULAYLIGI_REJASI.md):
   menyu (yakka havolalar, son belgisi, kichik sarlavha), topbar tugmalari, holat yorliqlari, tayyor sabablar,
   maydon xatolari, qoralama eslatmasi, "Bugun" bloki, Kiruvchilar, bo'sh holat, Yordam sahifasi. */

/* ---------- Menyu ---------- */
a.nav-top-link { text-decoration: none; margin-bottom: 2px; }
a.nav-top-link.active {
    background: linear-gradient(135deg, rgba(var(--teal-48-rgb), 0.12) 0%, rgba(var(--teal-56-rgb), 0.06) 100%);
    border-color: rgba(var(--teal-56-rgb), 0.2);
    color: var(--primary);
    font-weight: 700;
}
.nav-count {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; background: #f59e0b; color: #1f1300; flex-shrink: 0;
}
.nav-sub-heading {
    font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); padding: 10px 11px 4px;
}

/* ---------- Topbar ---------- */
.topbar-icon-btn {
    position: relative; width: 38px; height: 38px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-secondary); background: transparent; border: 1px solid var(--border-color);
    text-decoration: none; font-size: 16px; flex-shrink: 0;
}
.topbar-icon-btn:hover { background: rgba(var(--teal-56-rgb), 0.08); color: var(--primary); }
.topbar-count {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: #dc2626; color: #fff; font-size: 10.5px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bg-surface);
}

/* ---------- Fokus (klaviatura bilan ishlash) ---------- */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, summary:focus-visible {
    outline: 3px solid rgba(var(--teal-52-rgb), 0.55); outline-offset: 2px; border-radius: 6px;
}

/* ---------- Holat yorlig'i va keyingi qadam ---------- */
.review-status {
    display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.review-status--gray { background: #f1f5f9; color: #475569; }
.review-status--amber { background: #fef3c7; color: #92400e; }
.review-status--green { background: #dcfce7; color: #166534; }
.review-status--red { background: #fee2e2; color: #991b1b; }
.review-status-hint { display: inline-block; margin-left: 6px; font-size: 11.5px; color: var(--text-muted); }
html.dark-theme .review-status--gray, body.dark-theme .review-status--gray { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
html.dark-theme .review-status--amber, body.dark-theme .review-status--amber { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
html.dark-theme .review-status--green, body.dark-theme .review-status--green { background: rgba(34, 197, 94, 0.16); color: #86efac; }
html.dark-theme .review-status--red, body.dark-theme .review-status--red { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }

/* ---------- Tayyor qaytarish sabablari ---------- */
.reason-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reason-chip {
    border: 1px dashed var(--border-strong); background: transparent; color: var(--text-secondary);
    border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; min-height: 28px; font-family: inherit;
}
.reason-chip:hover { border-style: solid; color: var(--text-main); background: rgba(var(--teal-56-rgb), 0.06); }

/* ---------- Maydon xatolari va qoralama ---------- */
.field-error { color: #b91c1c; font-size: 12px; margin-top: 4px; }
.field-error:empty { display: none; }
html.dark-theme .field-error, body.dark-theme .field-error { color: #fca5a5; }
[aria-invalid="true"] { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important; }
.draft-note {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 12px;
    border-radius: 10px; font-size: 12.5px; background: rgba(var(--teal-56-rgb), 0.08); color: var(--text-main);
}
.draft-clear { border: none; background: none; color: var(--primary); font-weight: 700; cursor: pointer; text-decoration: underline; font-family: inherit; }

/* ---------- Bosh sahifa: "Bugun" ---------- */
.today-block { margin-bottom: 22px; }
.today-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.today-head h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--text-main); }
.today-head p { margin: 0; color: var(--text-muted); font-size: 13px; }
.today-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.today-card {
    display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
    background: var(--bg-surface); border: 1px solid var(--border-color); border-left: 4px solid var(--tone, #64748b);
    text-decoration: none; color: inherit;
}
a.today-card:hover { box-shadow: var(--shadow-card, 0 4px 14px rgba(15, 23, 42, 0.08)); }
.today-card--amber { --tone: #d97706; }
.today-card--red { --tone: #dc2626; }
.today-card--green { --tone: #16a34a; }
.today-card--blue { --tone: var(--teal-52); }
.today-card .today-icon { font-size: 18px; color: var(--tone); margin-top: 2px; width: 22px; text-align: center; }
.today-card .today-value { font-size: 24px; font-weight: 800; line-height: 1; color: var(--text-main); }
.today-card .today-title { font-weight: 700; font-size: 13.5px; margin-top: 4px; color: var(--text-main); }
.today-card .today-text { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.today-card .today-cta { font-size: 12px; font-weight: 700; color: var(--primary); margin-top: 6px; display: inline-block; }
.today-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.today-actions .btn { min-height: 40px; }
.today-panel {
    padding: 14px 16px; border-radius: 14px; background: var(--bg-surface); border: 1px solid var(--border-color); margin-bottom: 12px;
}
.today-panel h3 { margin: 0 0 8px; font-size: 14px; font-weight: 800; color: var(--text-main); }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li { padding: 8px 0; border-top: 1px solid var(--border-subtle); font-size: 13px; }
.today-list li:first-child { border-top: none; }
.today-list .muted { color: var(--text-muted); font-size: 12px; }
.today-note { display: block; margin-top: 3px; font-size: 12.5px; color: #991b1b; }
html.dark-theme .today-note, body.dark-theme .today-note { color: #fca5a5; }
.profile-meter { height: 8px; border-radius: 999px; background: var(--border-color); overflow: hidden; margin: 6px 0 8px; }
.profile-meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-52), #16a34a); }
.today-clear { color: #15803d; font-weight: 700; }
html.dark-theme .today-clear, body.dark-theme .today-clear { color: #86efac; }

/* ---------- Kiruvchilar ---------- */
.inbox-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.inbox-source {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; min-height: 36px;
    border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-secondary);
    text-decoration: none; font-size: 13px; font-weight: 600;
}
.inbox-source.active { border-color: var(--teal-52); color: var(--primary); background: rgba(var(--teal-56-rgb), 0.08); }
.inbox-source .n { font-weight: 800; color: var(--text-main); }
.inbox-wait { font-weight: 700; white-space: nowrap; }
.inbox-wait.late { color: #b91c1c; }
html.dark-theme .inbox-wait.late, body.dark-theme .inbox-wait.late { color: #fca5a5; }
tr[data-inbox-row].is-current td { background: rgba(var(--teal-56-rgb), 0.08); }
.kbd-hint { font-size: 12px; color: var(--text-muted); }
.kbd-hint kbd { font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border-strong); }

/* ---------- Bo'sh holat ---------- */
.empty-state { padding: 28px 16px; text-align: center; color: var(--text-muted); }
.empty-state > i { font-size: 26px; opacity: 0.5; display: block; margin-bottom: 8px; }
.empty-state p { margin: 0 0 12px; font-size: 13.5px; }
.empty-state .empty-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- Yordam sahifasi ---------- */
.help-layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.help-toc { position: sticky; top: 80px; padding: 14px; border-radius: 14px; background: var(--bg-surface); border: 1px solid var(--border-color); }
.help-toc a { display: block; padding: 7px 8px; border-radius: 8px; color: var(--text-secondary); text-decoration: none; font-size: 13px; min-height: 32px; }
.help-toc a.active, .help-toc a:hover { background: rgba(var(--teal-56-rgb), 0.08); color: var(--primary); font-weight: 700; }
.help-content { padding: 22px 26px; border-radius: 14px; background: var(--bg-surface); border: 1px solid var(--border-color); line-height: 1.65; color: var(--text-main); font-size: 14px; overflow-wrap: anywhere; }
.help-content h1 { font-size: 22px; margin: 0 0 12px; }
.help-content h2 { font-size: 18px; margin: 22px 0 8px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.help-content h3 { font-size: 15px; margin: 16px 0 6px; }
.help-content table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; display: block; overflow-x: auto; }
.help-content th, .help-content td { border: 1px solid var(--border-color); padding: 6px 9px; text-align: left; vertical-align: top; }
.help-content th { background: var(--bg-subtle); }
.help-content code { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; background: var(--bg-subtle); padding: 1px 5px; border-radius: 4px; }
.help-content blockquote { margin: 10px 0; padding: 8px 14px; border-left: 4px solid var(--teal-52); background: rgba(var(--teal-56-rgb), 0.06); border-radius: 0 8px 8px 0; }
.help-content hr { border: none; border-top: 1px solid var(--border-color); margin: 18px 0; }
.help-search { width: 100%; margin-bottom: 10px; }

@media screen and (max-width: 768px) {
    .help-layout { grid-template-columns: 1fr; }
    .help-toc { position: static; }
    .help-content { padding: 16px; }
}
@media screen and (max-width: 640px) {
    .today-cards { grid-template-columns: 1fr; }
    .today-actions .btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
    .reason-chip { min-height: 36px; }
}

/* ---------- Maqola qo'shish: bosqichli forma ---------- */
.pub-step-hint {
    display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px;
    border-radius: 12px; border: 1px solid var(--border-color); background: var(--bg-subtle); font-size: 13px; color: var(--text-secondary);
}
.pub-advanced { margin: 4px 0 14px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border-color); }
.pub-advanced > summary { cursor: pointer; font-weight: 700; font-size: 12.5px; min-height: 28px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pub-advanced[open] > summary { margin-bottom: 10px; }

/* ---------- Bildirishnomalar ---------- */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { display: flex; gap: 12px; padding: 12px 6px; border-top: 1px solid var(--border-subtle); font-size: 13.5px; }
.notif-item:first-child { border-top: none; }
.notif-item.unread { background: rgba(var(--teal-56-rgb), 0.06); border-radius: 10px; }
.notif-icon { font-size: 17px; margin-top: 2px; width: 22px; text-align: center; }
.notif-icon--green { color: #16a34a; }
.notif-icon--red { color: #dc2626; }
.notif-icon--blue { color: var(--teal-52); }
.notif-new { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #f59e0b; color: #1f1300; font-size: 10.5px; font-weight: 800; }

/* Telefonda topbar sig'ishi uchun: Kiruvchilar pastki menyuda, Yordam profil menyusida bor (kompyuterda u band takrorlanmaydi) */
.user-dropdown-item.show-sm-only { display: none; }
@media screen and (max-width: 640px) {
    .user-dropdown-item.show-sm-only { display: flex; }
    .topbar-icon-btn.hide-sm { display: none; }
    .topbar-icon-btn { width: 40px; height: 40px; }
}

/* ---------- Ro'yxatlarni sahifalash (views/partials/pagination.php) ---------- */
.list-pagination {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
    margin-top: 16px; font-size: 13px; color: var(--text-muted);
}
.list-pagination-summary strong { color: var(--text-primary); }
.list-pagination-size { display: inline-flex; align-items: center; gap: 4px; }
.list-pagination-size-label { margin-right: 4px; }
.list-pagination-size a {
    min-width: 40px; min-height: 32px; padding: 4px 10px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-secondary);
    font-weight: 600; text-decoration: none;
}
.list-pagination-size a:hover { border-color: var(--teal-52); color: var(--teal-52); }
.list-pagination-size a.active { background: var(--teal-52); border-color: var(--teal-52); color: #fff; }
.list-pagination-pages { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.list-pagination-pages .btn { min-width: 36px; justify-content: center; }
.list-pagination-gap { padding: 0 2px; }
@media screen and (max-width: 640px) {
    .list-pagination { justify-content: center; text-align: center; }
    .list-pagination-size a { min-height: 40px; }
}
/* Karta ichidagi ro'yxat ostida: jadvaldan chiziq bilan ajratiladi */
.list-pagination-card { padding: 0 20px 16px; border-top: 1px solid var(--border-color); }
.list-pagination-card:not(:has(.list-pagination)) { display: none; }

/* ---------- Ochiluvchi buyruqlar menyusi (<details class="action-menu">), masalan olim profilidagi "Hujjatlar" ---------- */
.action-menu { position: relative; display: inline-block; }
.action-menu > summary { list-style: none; cursor: pointer; user-select: none; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-caret { font-size: 10px; margin-left: 2px; transition: transform 0.15s ease; }
.action-menu[open] .action-menu-caret { transform: rotate(180deg); }
.action-menu-list {
    position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 270px; padding: 6px;
    display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 12px; box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}
.action-menu-list a, .action-menu-list button {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px;
    border: none; border-radius: 8px; background: none; color: var(--text-primary); font: inherit; font-size: 13.5px;
    text-align: left; text-decoration: none; cursor: pointer;
}
.action-menu-list a:hover, .action-menu-list button:hover,
.action-menu-list a:focus-visible, .action-menu-list button:focus-visible { background: var(--bg-subtle); }
.action-menu-list i { width: 18px; text-align: center; color: var(--teal-52); }
.action-menu-list small { margin-left: auto; color: var(--text-muted); font-size: 11.5px; }
@media screen and (max-width: 640px) {
    .action-menu-list { left: auto; right: 0; min-width: min(290px, calc(100vw - 32px)); }
}
