/* ============================================================
   OxuKids CRM вЂ” ko'prik (bridge) qatlami
   ui.css (Lid tizimi dizayn tizimi) tokenlarini Bootstrap 5
   komponentlari va plaginlarga (Select2, Flatpickr, DataTables,
   SweetAlert2) moslashtiradi. Yangi rang/shrift kiritilmaydi вЂ”
   faqat ui.css dagi CSS o'zgaruvchilari ishlatiladi.
   ============================================================ */

/* Muhim: ui.css'dagi fadeUp animatsiyasi `fill-mode: both` bilan tugagach ham
   elementda transform qoldiradi вЂ” bu esa position:fixed elementlar (jadval
   qator menyusi) uchun containing block yaratib, ularni buzadi.
   `backwards` вЂ” kirish effekti saqlanadi, transform qoldig'i yo'qoladi. */
.content > * { animation-fill-mode: backwards; }

/* ------------------------- Sahifa boshi qatori ------------------------- */
.page-head.compact {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 16px; min-height: 38px;
}
.page-head.compact .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.breadcrumbs a { display: inline-flex; align-items: center; }

/* ------------------------- Karta (Bootstrap struktura) ------------------------- */
/* ui.css'dagi .card padding 22px вЂ” to'g'ridan-to'g'ri kontentli kartalar uchun.
   Bootstrap strukturali (.card-header/.card-body) kartalarda esa 0 bo'ladi. */
.card:has(> .card-header), .card:has(> .card-body) { padding: 0; }
.card > .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-2);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    display: flex; align-items: center; gap: 10px;
    padding: 15px 22px;
}
.card > .card-header h5, .card > .card-header .h5 {
    font-family: var(--font-display); font-size: 15px; font-weight: 700;
    letter-spacing: -0.01em; color: var(--heading); margin: 0;
}
.card-header-icon {
    width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--gold-soft); color: var(--gold-text);
    font-size: 15px;
}
.card > .card-body { padding: 22px; }
.card > .card-body.p-0 { padding: 0; }
.filter-card .card-body { padding: 14px 22px; }

/* Kartadagi list-group (Bootstrap) */
.list-group { --bs-list-group-bg: transparent; --bs-list-group-color: var(--text);
    --bs-list-group-border-color: var(--border-2);
    --bs-list-group-action-hover-bg: var(--hover);
    --bs-list-group-action-hover-color: var(--heading);
    --bs-list-group-action-active-bg: var(--hover);
    --bs-list-group-action-active-color: var(--heading); }
.list-group-item { font-size: 13.5px; }

/* ------------------------- Tugmalar (Bootstrap -> tokenlar) ------------------------- */
.btn { --bs-btn-focus-box-shadow: var(--ring); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-primary, .btn-primary:focus {
    background: var(--royal); border-color: var(--royal); color: #fff;
}
.btn-primary:hover, .btn-primary:active {
    background: var(--royal-2) !important; border-color: var(--royal-2) !important;
    color: #fff !important;
    transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15, 138, 98, 0.3);
}
.btn-success, .btn-success:focus { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.btn-success:hover, .btn-success:active {
    background: #0d9668 !important; border-color: #0d9668 !important; color: #fff !important;
    transform: translateY(-1px); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}
.btn-light, .btn-light:focus {
    background: var(--surface); color: var(--label);
    border-color: var(--border); box-shadow: var(--shadow-xs);
}
.btn-light:hover, .btn-light:active {
    background: var(--surface) !important; border-color: var(--royal) !important;
    color: var(--royal) !important; transform: translateY(-1px);
}
.btn-outline-primary, .btn-outline-primary:focus {
    background: var(--surface); color: var(--royal); border-color: var(--border);
    box-shadow: var(--shadow-xs);
}
.btn-outline-primary:hover, .btn-outline-primary:active {
    background: var(--royal-soft) !important; color: var(--royal) !important;
    border-color: var(--royal) !important; transform: translateY(-1px);
}
.btn-outline-secondary, .btn-outline-secondary:focus {
    background: var(--surface); color: var(--label); border-color: var(--border);
}
.btn-outline-secondary:hover, .btn-outline-secondary:active {
    background: var(--hover) !important; color: var(--heading) !important;
    border-color: var(--border) !important;
}
.btn-outline-danger, .btn-outline-danger:focus {
    background: var(--red-soft); color: var(--red-text); border-color: transparent;
}
.btn-outline-danger:hover, .btn-outline-danger:active {
    background: var(--red) !important; color: #fff !important;
    border-color: var(--red) !important; transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

/* Jadval amal tugmalari (icon-btn ko'rinishi) */
.btn.btn-icon {
    width: 32px; height: 32px; padding: 0; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 9px;
    background: var(--surface); color: var(--muted);
    box-shadow: none; font-size: 13px;
}
.btn.btn-icon:hover {
    border-color: var(--royal) !important; color: var(--royal) !important;
    background: var(--surface) !important; transform: translateY(-1px);
}
.btn.btn-icon.text-danger { color: var(--red-text) !important; }
.btn.btn-icon.text-danger:hover {
    border-color: var(--red) !important; color: var(--red) !important;
}
.table-actions { display: inline-flex; gap: 6px; }

/* ------------------------- Formalar ------------------------- */
/* Grid (row g-3) ichida .form-field ning ui.css'dagi pastki bo'shlig'i ortiqcha */
.row .form-field { margin-bottom: 0; }

.form-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600; margin-bottom: 7px; color: var(--label);
}
.required-star { color: var(--red); font-weight: 700; margin-left: 2px; }

.form-control, .form-select {
    background: var(--input-bg); color: var(--text);
    border: 1px solid var(--input-border); border-radius: var(--radius-sm);
    font-size: 14px; padding: 9px 14px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.form-control::placeholder { color: var(--muted); opacity: 0.85; }
.form-control:focus, .form-select:focus {
    background: var(--input-bg); color: var(--text);
    border-color: var(--royal); box-shadow: var(--ring); outline: none;
}
.form-select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    padding-right: 38px;
}
.form-control:disabled, .form-select:disabled { background: var(--surface-2); color: var(--muted); }
.form-control[type="file"] { padding: 8px 12px; }
.form-control[type="file"]::file-selector-button {
    background: var(--surface-2); color: var(--label);
    border: 1px solid var(--border); border-radius: 8px;
    padding: 5px 12px; margin-right: 12px; font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: all 0.15s ease;
}
.form-control[type="file"]::file-selector-button:hover { border-color: var(--royal); color: var(--royal); }

.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--red); background-image: none;
}
.form-select.is-invalid {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ef4444' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.invalid-feedback { color: var(--red-text); font-size: 12px; font-weight: 500; margin-top: 5px; }
.form-text { color: var(--muted); font-size: 12px; margin-top: 5px; }

.form-actions {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 10px; padding: 16px 0 0;
}

.hint-box {
    background: var(--royal-soft); color: var(--royal);
    border: 1px solid rgba(15, 138, 98, 0.18);
    border-radius: var(--radius-sm);
    padding: 10px 14px; font-size: 13px;
}

.alert { border-radius: var(--radius-sm); font-size: 13.5px; border: 1px solid transparent; }
.alert-danger {
    background: var(--red-soft); color: var(--red-text);
    border-color: rgba(239, 68, 68, 0.25);
}

/* ------------------------- Jadval (Bootstrap + DataTables) ------------------------- */
/* Jadvalning O'ZI endi design system'da (ui.css v3, 30-31-bo'limlar):
   o'lchamlar, sarlavha uslubi, hover va tokenlar o'sha yerda. Bu yerda
   faqat Bootstrap'ga xos qo'shimchalar qoladi — aks holda app.css
   ui.css'dan keyin yuklanib, DS qoidalarini bosib qo'yardi. */
.table { margin-bottom: 0; }
.table-link { color: var(--heading); text-decoration: none; font-weight: 600; }
.table-link:hover { color: var(--royal); }

/* DataTables 2 boshqaruv elementlari */
div.dt-container { font-size: 13px; color: var(--muted); }
div.dt-container .dt-search input {
    background: var(--input-bg); color: var(--text);
    border: 1px solid var(--input-border); border-radius: 10px;
    padding: 7px 12px; font-size: 12.5px; outline: none; margin-left: 8px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
div.dt-container .dt-search input:focus { border-color: var(--royal); box-shadow: var(--ring); }
div.dt-container .dt-length select {
    background-color: var(--input-bg); color: var(--text);
    border: 1px solid var(--input-border); border-radius: 10px;
    padding: 6px 30px 6px 10px; font-size: 12.5px; margin-right: 6px;
}
div.dt-container .dt-info { color: var(--muted); font-size: 12px; padding-top: 12px; }
div.dt-container .dt-paging .dt-paging-button {
    border-radius: 9px; margin: 0 2px; padding: 5px 11px;
    color: var(--label) !important; border: 1px solid transparent;
    background: none; font-size: 12.5px;
}
div.dt-container .dt-paging .dt-paging-button:hover {
    background: var(--hover) !important; border-color: var(--border) !important;
    color: var(--heading) !important; box-shadow: none;
}
div.dt-container .dt-paging .dt-paging-button.current {
    background: var(--royal) !important; border-color: var(--royal) !important;
    color: #fff !important;
}
div.dt-container .dt-paging .dt-paging-button.disabled {
    color: var(--muted) !important; opacity: 0.5;
}

/* ------------------------- Badge (soft) ------------------------- */
/* O'lcham design system'dan (ui.css v3, 39-bo'lim: .status/.pill bilan
   bir xil balandlik) — bu yerda faqat rang variantlari qoladi. */
.badge[class*="badge-soft-"] { border: 1px solid transparent; white-space: nowrap; }
.badge-soft-success { background: var(--emerald-soft); color: var(--emerald-text); border-color: rgba(16, 185, 129, 0.25); }
.badge-soft-secondary { background: var(--surface-2); color: var(--label); border-color: var(--border); }
.badge-soft-warning { background: var(--amber-soft); color: var(--amber-text); border-color: rgba(245, 158, 11, 0.28); }
.badge-soft-danger { background: var(--red-soft); color: var(--red-text); border-color: rgba(239, 68, 68, 0.25); }
.badge-soft-info { background: var(--cyan-soft); color: var(--cyan-text); border-color: rgba(6, 182, 212, 0.25); }
.badge-soft-primary { background: var(--royal-soft); color: var(--royal); border-color: rgba(15, 138, 98, 0.25); }
:root[data-theme="dark"] .badge-soft-primary { color: var(--royal-2); }

/* ------------------------- Avatar ------------------------- */
.avatar.avatar-initials, .avatar.avatar-img {
    width: 32px; height: 32px; border-radius: 10px;
    font-size: 12px;
}
.avatar.avatar-img { object-fit: cover; background: var(--surface-2); }
.avatar.avatar-xl {
    width: 84px; height: 84px; border-radius: 22px; font-size: 26px;
}
.profile-photo {
    width: 104px; height: 104px; border-radius: 26px; object-fit: cover;
    border: 2px solid rgba(201, 162, 39, 0.55);
    box-shadow: var(--shadow);
}

/* ------------------------- Detail sahifa ------------------------- */
.detail-list { margin: 0; }
.detail-row {
    display: flex; gap: 12px; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid var(--border-2); font-size: 13.5px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row dt { color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.detail-row dd { margin: 0; color: var(--text); font-weight: 600; text-align: right; min-width: 0; }

/* ------------------------- Bootstrap Modal ------------------------- */
/* Modal ko'rinishi design system'da (ui.css v3, 34-bo'lim). Bu yerda
   faqat NOM TO'QNASHUVI hal qilinadi: `.modal-dialog` ui.css'da o'z
   modalimizning KARTASI, Bootstrap'da esa markazlashtiruvchi o'ram —
   shuning uchun Bootstrap ichida u butunlay neytrallanadi. */
.modal .modal-dialog {
    background: transparent; border: 0; box-shadow: none; padding: 0;
    animation: none; max-width: var(--bs-modal-width);
    max-height: none; overflow: visible;
}
.modal-title i { color: var(--gold); }
.btn-close { filter: none; opacity: 0.55; }
:root[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%); }

/* ------------------------- Select2 (default tema -> tokenlar) ------------------------- */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background: var(--input-bg); border: 1px solid var(--input-border);
    border-radius: var(--radius-sm); min-height: 41px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--royal); box-shadow: var(--ring);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text); line-height: 39px; padding-left: 14px; padding-right: 30px;
    font-size: 14px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--muted); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 39px; right: 8px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--muted) transparent transparent transparent;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--muted) transparent;
}
.select2-container--default .select2-selection--single .select2-selection__clear,
.select2-container--default .select2-selection--multiple .select2-selection__clear {
    color: var(--muted); font-weight: 600; margin-right: 4px;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered { padding: 3px 8px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--royal-soft); border: 1px solid rgba(15, 138, 98, 0.25);
    border-radius: 8px; color: var(--royal); font-size: 12.5px;
    padding: 2px 8px; margin: 4px 4px 0 0;
}
:root[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice { color: var(--royal-2); }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: inherit; border-right: none; margin-right: 4px; padding: 0 2px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: transparent; color: var(--red);
}
.select2-dropdown {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    color: var(--text); overflow: hidden; z-index: 1060;
}
.select2-search--dropdown { padding: 8px; }
.select2-search--dropdown .select2-search__field {
    background: var(--input-bg); color: var(--text);
    border: 1px solid var(--input-border); border-radius: 9px;
    padding: 7px 11px; font-size: 13px; outline: none; font-family: inherit;
}
.select2-search--dropdown .select2-search__field:focus { border-color: var(--royal); box-shadow: var(--ring); }
.select2-results__option { padding: 8px 12px; font-size: 13.5px; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--royal-soft); color: var(--heading);
}
.select2-container--default .select2-results__option--selected { background: var(--surface-2); color: var(--muted); }
.select2-results__message { color: var(--muted); }

/* ------------------------- Flatpickr ------------------------- */
.flatpickr-calendar {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    color: var(--text); font-family: inherit;
}
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { display: none; }
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { color: var(--heading); fill: var(--heading); }
.flatpickr-current-month .flatpickr-monthDropdown-months { background: var(--surface); }
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { background: var(--surface); color: var(--text); }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { fill: var(--muted); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--royal); }
span.flatpickr-weekday { color: var(--muted); font-weight: 600; }
.flatpickr-day { color: var(--text); border-radius: 9px; }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--hover); border-color: var(--hover); }
.flatpickr-day.today { border-color: var(--gold); }
.flatpickr-day.today:hover { background: var(--gold-soft); color: var(--gold-text); }
.flatpickr-day.selected, .flatpickr-day.selected:hover {
    background: var(--royal); border-color: var(--royal); color: #fff;
}
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--muted); opacity: 0.45; }

/* ------------------------- SweetAlert2 ------------------------- */
.swal2-popup {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    font-family: var(--font-sans); box-shadow: var(--shadow-lg);
}
.swal2-title { color: var(--heading); font-family: var(--font-display); font-size: 20px; }
.swal2-html-container { color: var(--text); font-size: 14px; }
.swal2-styled { border-radius: 11px !important; font-weight: 600 !important; font-family: inherit !important; }
div:where(.swal2-container) .swal2-popup.swal2-toast {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); box-shadow: var(--shadow-lg);
    border-radius: 13px; padding: 10px 14px;
}
.swal2-timer-progress-bar { background: rgba(15, 138, 98, 0.35); }

/* ------------------------- Step-form (bola qo'shish) ------------------------- */
.step-indicator-card .card-body { overflow-x: auto; padding: 16px 22px; }
.step-indicator { display: flex; gap: 4px; min-width: 720px; }
.step-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: none; border: 0; padding: 4px; position: relative;
    color: var(--muted); cursor: pointer; font-family: inherit;
}
.step-item:not(:last-child)::after {
    content: ""; position: absolute; top: 22px;
    left: calc(50% + 26px); width: calc(100% - 52px); height: 2px;
    background: var(--border-2);
}
.step-item.completed:not(:last-child)::after { background: var(--royal); }
.step-circle {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface); border: 2px solid var(--border);
    font-size: 14px; position: relative; z-index: 1;
    transition: all 0.2s ease;
}
.step-label { font-size: 11px; font-weight: 600; white-space: nowrap; }
.step-item.active { color: var(--royal); }
.step-item.active .step-circle {
    border-color: var(--royal); background: var(--royal); color: #fff;
    box-shadow: var(--ring);
}
.step-item.completed { color: var(--royal); }
.step-item.completed .step-circle {
    border-color: var(--royal); background: var(--royal-soft); color: var(--royal);
}
.step-item.has-error { color: var(--red-text); }
.step-item.has-error .step-circle {
    border-color: var(--red); background: var(--red-soft); color: var(--red-text);
}
.step-progress { height: 5px; border-radius: 999px; background: var(--border-2); }
.step-progress .progress-bar { background: var(--royal); border-radius: 999px; transition: width 0.25s ease; }
.step-nav { align-items: center; }

/* ------------------------- Fayl preview / hujjatlar ------------------------- */
.file-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file-preview-item {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 6px 10px; font-size: 12px; max-width: 100%;
}
.file-preview-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.file-preview-item i { font-size: 20px; color: var(--royal); }
.file-preview-item .file-name {
    max-width: 180px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-weight: 600; color: var(--text);
}
.file-preview-item .file-size { color: var(--muted); }

.document-card {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden; background: var(--surface);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.document-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.document-thumb {
    display: grid; place-items: center; height: 104px;
    background: var(--surface-2); color: var(--royal); font-size: 28px;
    text-decoration: none;
}
.document-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* Fayl ochilmadi (404 / buzilgan fayl): buzilgan rasm o'rniga aniq holat.
   `onerror` shu sinfni qo'yadi — sabab nima bo'lishidan qat'i nazar
   (server bermadi, fayl yo'q, format buzuq) foydalanuvchi tushunadi. */
.document-thumb.is-missing { color: var(--red-text); background: var(--red-soft); font-size: 22px; }
.document-thumb.is-missing img { display: none; }
.document-thumb .doc-missing {
    display: none; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px; text-align: center; line-height: 1.3;
}
.document-thumb.is-missing .doc-missing { display: flex; }
.document-thumb .doc-missing small { font-size: 11px; font-weight: 600; }
.document-info {
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border-2);
}
.document-title {
    font-size: 12px; font-weight: 600; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ------------------------- Dashboard: so'nggi bolalar ------------------------- */
.recent-list { display: flex; flex-direction: column; }
.recent-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px; margin: 0 -10px; border-radius: 12px;
    text-decoration: none; transition: background 0.14s ease;
}
.recent-row:hover { background: var(--surface-2); }
.recent-row .avatar { flex-shrink: 0; }
.recent-row .r-info { flex: 1; min-width: 0; }
.recent-row .r-info b {
    display: block; font-size: 13px; font-weight: 600; color: var(--heading);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent-row .r-info small { color: var(--muted); font-size: 11.5px; }
.recent-row .r-arrow {
    color: var(--muted); display: inline-flex;
    transition: transform 0.16s ease, color 0.16s ease;
}
.recent-row:hover .r-arrow { color: var(--royal); transform: translateX(3px); }

/* ------------------------- Loading overlay ------------------------- */
.loading-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: var(--glass);
    backdrop-filter: blur(3px);
    display: none; place-items: center;
}
.loading-overlay.show { display: grid; }
.spin-lg {
    width: 44px; height: 44px; border-radius: 50%;
    border: 3px solid var(--royal-soft); border-top-color: var(--royal);
    animation: spin 0.7s linear infinite; display: inline-block;
}

/* ------------------------- Mayda moslashtirishlar ------------------------- */
.text-muted { color: var(--muted) !important; }
hr { border-color: var(--border-2); opacity: 1; }
.dropdown-menu form { margin: 0; }

/* Bootstrap grid ichidagi .card to'liq balandlik */
.card.h-100 { height: 100%; }

@media (max-width: 720px) {
    .page-head.compact { margin-bottom: 12px; }
    .card > .card-body { padding: 16px; }
    .card > .card-header { padding: 13px 16px; }
}

/* ------------------------- Sidebar bo'lim guruhlari (dropdown) ------------------------- */
.menu .nav-group { display: flex; flex-direction: column; }
.menu .nav-group-toggle {
    display: flex; align-items: center; gap: 11px; width: 100%;
    height: 40px; padding: 0 10px; border-radius: 10px;
    color: #aab6da; background: none; border: none; cursor: pointer;
    font-family: inherit; font-size: 13.5px; font-weight: 500; letter-spacing: 0.01em;
    transition: background 0.16s ease, color 0.16s ease;
    white-space: nowrap;
}
.menu .nav-group-toggle .ic-slot {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.16s ease, color 0.16s ease;
}
.menu .nav-group-toggle .i { width: 18px; height: 18px; }
.menu .nav-group-toggle:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.menu .nav-group-toggle:hover .ic-slot { background: rgba(255, 255, 255, 0.1); }
.menu .nav-group-toggle .chev {
    margin-left: auto; display: inline-flex; color: #66739f;
    transition: transform 0.2s ease;
}
.menu .nav-group.open .nav-group-toggle { color: #fff; }
.menu .nav-group.open .nav-group-toggle .ic-slot {
    background: rgba(201, 162, 39, 0.18); color: var(--gold-2);
}
.menu .nav-group.open .nav-group-toggle .chev { transform: rotate(180deg); }

.menu .nav-sub {
    display: flex; flex-direction: column; gap: 2px;
    max-height: 0; overflow: hidden; padding-left: 12px;
    transition: max-height 0.28s ease;
}
.menu .nav-group.open .nav-sub { max-height: 640px; }
.menu .nav-sub a { height: 36px; font-size: 13px; }
.menu .nav-sub a .ic-slot { width: 26px; height: 26px; border-radius: 8px; }
.menu .nav-sub a .i { width: 15px; height: 15px; }

body.sb-mini .menu .nav-group-toggle { justify-content: center; padding: 0; }
body.sb-mini .menu .nav-group-toggle .label,
body.sb-mini .menu .nav-group-toggle .chev { display: none; }
body.sb-mini .menu .nav-sub { padding-left: 0; }

@media (max-width: 1100px) {
    .menu .nav-group-toggle { justify-content: center; padding: 0; }
    .menu .nav-group-toggle .label, .menu .nav-group-toggle .chev { display: none; }
    .menu .nav-sub { padding-left: 0; }
}
@media (max-width: 720px) {
    .menu .nav-group-toggle { justify-content: flex-start; padding: 0 10px; }
    .menu .nav-group-toggle .label, .menu .nav-group-toggle .chev { display: revert; }
    .menu .nav-sub { padding-left: 12px; }
}

/* Rejadagi modullar — hali ishlab chiqilmagan («Tez orada») */
.menu a.soon { opacity: 0.45; pointer-events: none; cursor: default; }
.menu .soon-tag {
    margin-left: 6px; padding: 2px 6px; border-radius: 999px;
    font-size: 9px; font-style: normal; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
    background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.78);
    vertical-align: middle;
}

/* ------------------------- Jadval qator menyusi ------------------------- */
.table-dd { display: inline-block; }
.table-dd .dropdown-menu { min-width: 178px; }
.table-dd .dd-toggle[aria-expanded="true"] {
    border-color: var(--royal) !important; color: var(--royal) !important;
}

/* Dropdown item ichidagi bootstrap-icons glifi */
.dropdown-item .bi {
    width: 16px; font-size: 14px; color: var(--muted); text-align: center;
    flex-shrink: 0;
}
.dropdown-item:hover .bi { color: var(--royal); }
.dropdown-item.danger .bi { color: var(--red-text); }

/* ------------------------- Checkbox / switch ------------------------- */
.form-check { display: flex; align-items: center; gap: 9px; min-height: 41px; }
.form-check-input {
    background-color: var(--input-bg); border-color: var(--input-border);
    margin-top: 0; flex-shrink: 0; cursor: pointer;
}
.form-check-input:checked { background-color: var(--royal); border-color: var(--royal); }
.form-check-input:focus { border-color: var(--royal); box-shadow: var(--ring); }
.form-check-label { font-size: 13px; font-weight: 600; color: var(--label); cursor: pointer; }
.form-switch .form-check-input { width: 2.3em; height: 1.25em; }

/* ============================================================
   Dashboard v2 — gradient KPI, grafiklar, timeline, bandlik
   ============================================================ */

/* Kirish animatsiyasi */
@keyframes dashUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
.anim-up { animation: dashUp 0.45s ease both; }

/* ---------- Gradient KPI kartalar ---------- */
.kpix-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 1400px) { .kpix-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .kpix-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kpix-grid { grid-template-columns: 1fr; } }

.kpix {
    position: relative;
    display: flex; flex-direction: column; gap: 10px;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--g1), var(--g2));
    color: #fff; text-decoration: none;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--g2) 32%, transparent);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}
.kpix::after {
    content: "";
    position: absolute; right: -34px; top: -34px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}
.kpix:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 14px 30px color-mix(in srgb, var(--g2) 45%, transparent); }
.kpix .kx-top { display: flex; align-items: center; gap: 10px; }
.kpix .kx-ic {
    width: 38px; height: 38px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
}
.kpix .kx-ic .i { width: 19px; height: 19px; }
.kpix .kx-label { font-size: 13px; font-weight: 600; opacity: 0.92; }
.kpix .kx-num {
    font-family: var(--font-display);
    font-size: 34px; font-weight: 800; line-height: 1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}
.kpix .kx-chip {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 999px;
    background: rgba(0, 0, 0, 0.16);
    font-size: 11.5px; font-weight: 600;
}
.kpix .kx-chip .i { width: 12px; height: 12px; }

/* ---------- Bugungi ko'rsatkichlar (strip) ---------- */
.today-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
@media (max-width: 1200px) { .today-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .today-strip { grid-template-columns: 1fr 1fr; } }
.ts-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow-xs);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.ts-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.ts-ic {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--kc) 12%, transparent);
    color: var(--kc);
}
.ts-ic .i { width: 18px; height: 18px; }
.ts-tx { min-width: 0; }
.ts-tx b {
    display: block; font-family: var(--font-display);
    font-size: 18px; font-weight: 800; color: var(--heading);
    line-height: 1.15; font-variant-numeric: tabular-nums;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ts-tx small { color: var(--muted); font-size: 11.5px; }

/* ---------- Grafik konteynerlar ---------- */
.chart-box { position: relative; height: 280px; margin-top: 6px; }
.donut-box { height: 230px; }
.donut-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    pointer-events: none;
}
.donut-center b {
    font-family: var(--font-display);
    font-size: 30px; font-weight: 800; color: var(--heading);
    line-height: 1; font-variant-numeric: tabular-nums;
}
.donut-center small { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.donut-legend { margin-top: 14px; display: grid; gap: 8px; }
.dl-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.dl-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dl-name { flex: 1; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-row b { color: var(--heading); font-variant-numeric: tabular-nums; }
.dl-row small { color: var(--muted); width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- So'nggi o'quvchilar qatoridagi meta ---------- */
.recent-row .r-meta {
    display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
    flex-shrink: 0;
}
.recent-row .r-meta small { color: var(--muted); font-size: 11px; }
@media (max-width: 640px) { .recent-row .r-meta { display: none; } }

/* ---------- Sinflar bandligi ---------- */
.fill-list { display: grid; gap: 6px; margin-top: 4px; }
.fill-row {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 10px; border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.14s ease;
}
.fill-row:hover { background: var(--surface-2); }
.fill-row .f-name { width: 150px; min-width: 0; flex-shrink: 0; }
.fill-row .f-name b {
    display: block; font-size: 13px; color: var(--heading);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fill-row .f-name small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.fill-row .f-bar { flex: 1; }
.fill-row .f-track {
    display: block; height: 8px; border-radius: 999px;
    background: var(--border-2); overflow: hidden;
}
.fill-row .f-progress {
    display: block; height: 100%; width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--fc, #22c55e) 75%, #fff), var(--fc, #22c55e));
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.fill-row .f-count { color: var(--label); font-size: 12.5px; font-variant-numeric: tabular-nums; width: 52px; text-align: right; }
.fill-row .f-pct { color: var(--heading); font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; width: 40px; text-align: right; }

/* ---------- So'nggi faoliyat (timeline) ---------- */
.tl { position: relative; margin-top: 4px; display: grid; gap: 2px; }
.tl::before {
    content: ""; position: absolute; left: 5px; top: 12px; bottom: 12px;
    width: 2px; background: var(--border-2); border-radius: 2px;
}
.tl-row {
    position: relative;
    display: flex; align-items: flex-start; gap: 14px;
    padding: 8px 6px 8px 0;
}
.tl-dot {
    position: relative; z-index: 1;
    width: 12px; height: 12px; border-radius: 50%;
    margin-top: 4px; flex-shrink: 0;
    border: 2.5px solid var(--surface);
    box-shadow: 0 0 0 2px var(--border-2);
}
.tl-dot.ok { background: #22c55e; }
.tl-dot.warn { background: #f59e0b; }
.tl-dot.info { background: #2563eb; }
.tl-dot.danger { background: #ef4444; }
.tl-tx { min-width: 0; }
.tl-tx b { display: block; font-size: 13px; font-weight: 600; color: var(--heading); }
.tl-tx small { color: var(--muted); font-size: 11.5px; }
