/* ============================================================
   Tiba Agent — Komponentlar
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   Tugmalar
   ──────────────────────────────────────────────────────────── */

.btn {
    --btn-bg: var(--surface);
    --btn-color: var(--text);
    --btn-border: var(--border);
    --btn-shadow: var(--shadow-xs);

    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 42px;
    padding: 0 var(--space-5);
    border-radius: var(--radius-md);
    background: var(--btn-bg);
    color: var(--btn-color);
    border: 1px solid var(--btn-border);
    box-shadow: var(--btn-shadow);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-normal);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    isolation: isolate;
    transition: transform var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                opacity var(--dur-fast) var(--ease-out);
}

.btn:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0) scale(0.985);
    transition-duration: 0.06s;
}

.btn:disabled,
.btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
    transform: none;
}

.btn .ico {
    width: 1.15em;
    height: 1.15em;
}

/* Variantlar */

.btn-primary {
    --btn-bg: var(--brand);
    --btn-color: #fff;
    --btn-border: transparent;
    --btn-shadow: var(--shadow-brand);
    background-image: var(--gradient-brand);
    background-size: 160% 160%;
    background-position: 0% 50%;
    transition: background-position var(--dur-slow) var(--ease-out),
                transform var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out);
}

.btn-primary:hover {
    /* .btn:hover fonni kulrangga almashtiradi — rangli tugma rangini saqlasin */
    background-color: var(--btn-bg);
    background-image: var(--gradient-brand);
    background-position: 100% 50%;
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.42);
}

.btn-secondary {
    --btn-bg: var(--surface);
    --btn-border: var(--border-strong);
}

.btn-ghost {
    --btn-bg: transparent;
    --btn-border: transparent;
    --btn-shadow: none;
}

.btn-ghost:hover {
    background: var(--surface-hover);
    box-shadow: none;
}

.btn-soft {
    --btn-bg: var(--brand-soft);
    --btn-color: var(--brand-text);
    --btn-border: transparent;
    --btn-shadow: none;
}

.btn-soft:hover {
    --btn-bg: var(--brand-soft);
    filter: brightness(1.06);
}

.btn-success {
    --btn-bg: var(--success);
    --btn-color: #fff;
    --btn-border: transparent;
    --btn-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    --btn-bg: var(--danger);
    --btn-color: #fff;
    --btn-border: transparent;
    --btn-shadow: 0 4px 16px rgba(239, 68, 68, 0.28);
}

.btn-danger-soft {
    --btn-bg: var(--danger-soft);
    --btn-color: var(--danger-text);
    --btn-border: transparent;
    --btn-shadow: none;
}

.btn-dark {
    --btn-bg: var(--text);
    --btn-color: var(--bg);
    --btn-border: transparent;
}

/* Rangli tugmalar hover'da o'z rangida qoladi (biroz yorqinroq) */
.btn-soft:hover,
.btn-success:hover,
.btn-danger:hover,
.btn-danger-soft:hover,
.btn-dark:hover {
    background: var(--btn-bg);
    filter: brightness(1.06);
}

/* O'lchamlar */

.btn-xs { height: 30px; padding: 0 var(--space-3); font-size: var(--text-xs); border-radius: var(--radius-sm); gap: 5px; }
.btn-sm { height: 36px; padding: 0 var(--space-4); font-size: var(--text-sm); border-radius: var(--radius-sm); }
.btn-lg { height: 50px; padding: 0 var(--space-6); font-size: var(--text-md); border-radius: var(--radius-lg); }
.btn-xl { height: 56px; padding: 0 var(--space-8); font-size: var(--text-lg); border-radius: var(--radius-lg); }

.btn-block { width: 100%; }

.btn-icon {
    width: 42px;
    padding: 0;
    flex: none;
}

.btn-icon.btn-sm { width: 36px; }
.btn-icon.btn-xs { width: 30px; }
.btn-icon.btn-lg { width: 50px; }

/* Yuklanish holati */

.btn.is-loading {
    color: transparent !important;
    pointer-events: none;
}

.btn.is-loading::after {
    content: "";
    position: absolute;
    width: 17px;
    height: 17px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    color: var(--btn-color);
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ────────────────────────────────────────────────────────────
   Kartalar
   ──────────────────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--dur-base) var(--ease-out),
                transform var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out);
}

.card-hover:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border-strong);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: var(--text-md);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-tight);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

.card-body {
    padding: var(--space-6);
}

.card-body-tight { padding: var(--space-4); }

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

.card-flush { box-shadow: none; }

/* Shisha effekti */
.card-glass {
    background: var(--surface-glass);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
}

/* ────────────────────────────────────────────────────────────
   Belgilar (badge / chip)
   ──────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-full);
    background: var(--surface-3);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-normal);
    white-space: nowrap;
}

.badge .ico { width: 13px; height: 13px; stroke-width: 2.1; }

.badge-brand   { background: var(--brand-soft);   color: var(--brand-text); }
.badge-success { background: var(--success-soft); color: var(--success-text); }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger-text); }
.badge-info    { background: var(--info-soft);    color: var(--info-text); }
.badge-muted   { background: var(--surface-3);    color: var(--text-tertiary); }

.badge-lg { height: 30px; padding: 0 var(--space-4); font-size: var(--text-sm); }
.badge-dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.badge-pulse::before {
    animation: pulse-dot 1.8s var(--ease-in-out) infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.75); }
}

/* ────────────────────────────────────────────────────────────
   Forma
   ──────────────────────────────────────────────────────────── */

.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.field + .field { margin-top: var(--space-5); }

.label {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.label .req { color: var(--danger); }

.input,
.select,
.textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: var(--text-base);
    transition: border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out);
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: var(--text-tertiary);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--ring);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
    background: var(--surface-3);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid {
    border-color: var(--danger);
}

.input.is-invalid:focus {
    box-shadow: 0 0 0 3.5px var(--danger-soft);
}

.select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: var(--space-10);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a94' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    cursor: pointer;
}

.field-hint {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    line-height: var(--leading-snug);
}

.field-error {
    font-size: var(--text-xs);
    color: var(--danger-text);
    font-weight: var(--weight-medium);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Prefiksli input (telefon) */

.input-group {
    display: flex;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}

.input-group:focus-within {
    border-color: var(--brand);
    box-shadow: var(--ring);
}

.input-group .input {
    border: none;
    border-radius: 0;
    background: transparent;
}

.input-group .input:focus {
    box-shadow: none;
}

.input-prefix,
.input-suffix {
    display: flex;
    align-items: center;
    padding: 0 var(--space-4);
    background: var(--surface-3);
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    white-space: nowrap;
    flex: none;
}

.input-suffix { border-left: 1px solid var(--border); }
.input-prefix { border-right: 1px solid var(--border); }

/* Checkbox va radio */

.check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
}

.check input {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    flex: none;
    margin-top: 1px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-xs);
    background: var(--surface);
    cursor: pointer;
    position: relative;
    transition: all var(--dur-fast) var(--ease-out);
}

.check input[type="radio"] { border-radius: 50%; }

.check input:checked {
    background: var(--brand);
    border-color: var(--brand);
}

.check input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat;
}

.check input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: #fff;
}

.check input:focus-visible {
    box-shadow: var(--ring);
    outline: none;
}

.check-text {
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
}

.check-title {
    font-weight: var(--weight-medium);
    color: var(--text);
    display: block;
}

.check-hint {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}

/* Switch */

.switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    cursor: pointer;
}

.switch + .switch { border-top: 1px solid var(--border); }

.switch-input {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 50px;
    height: 30px;
    flex: none;
    border-radius: var(--radius-full);
    background: var(--border-strong);
    cursor: pointer;
    transition: background-color var(--dur-base) var(--ease-out);
}

.switch-input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform var(--dur-base) var(--ease-spring);
}

.switch-input:checked {
    background: var(--brand);
}

.switch-input:checked::after {
    transform: translateX(20px);
}

.switch-input:focus-visible {
    box-shadow: var(--ring);
    outline: none;
}

/* Segmentli boshqaruv (Apple uslubi) */

.segmented {
    display: inline-flex;
    padding: 3px;
    background: var(--surface-3);
    border-radius: var(--radius-md);
    gap: 2px;
}

.segmented-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
}

.segmented-item:hover { color: var(--text); }

.segmented-item.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}

/* ────────────────────────────────────────────────────────────
   Avatar
   ──────────────────────────────────────────────────────────── */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: var(--radius-full);
    background: var(--gradient-brand);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: 0;
    overflow: hidden;
    user-select: none;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-xs { width: 26px; height: 26px; font-size: var(--text-2xs); }
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-md); }
.avatar-xl { width: 80px; height: 80px; font-size: var(--text-xl); }

.avatar-square { border-radius: var(--radius-md); }

/* ────────────────────────────────────────────────────────────
   Jadval
   ──────────────────────────────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    min-width: 640px;
    font-size: var(--text-sm);
}

.table thead th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--surface-2);
}

.table tbody td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color var(--dur-fast) var(--ease-out);
}

.table tbody tr:hover {
    background: var(--surface-hover);
}

.table tbody tr:last-child td { border-bottom: none; }

.table .num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    white-space: nowrap;
}

.table .right { text-align: right; }

/* ────────────────────────────────────────────────────────────
   Toast
   ──────────────────────────────────────────────────────────── */

.toast-stack {
    position: fixed;
    top: calc(var(--header-h) + 12px);
    right: var(--space-4);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in var(--dur-slow) var(--ease-spring) both;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--toast-color, var(--brand));
}

.toast-success { --toast-color: var(--success); }
.toast-error   { --toast-color: var(--danger); }
.toast-warning { --toast-color: var(--warning); }
.toast-info    { --toast-color: var(--info); }

.toast-icon {
    width: 34px;
    height: 34px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--toast-color) 14%, transparent);
    color: var(--toast-color);
}

.toast-icon .ico { width: 18px; height: 18px; }

.toast-body { flex: 1; min-width: 0; }

.toast-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    margin-bottom: 2px;
}

.toast-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-snug);
    word-break: break-word;
}

.toast-close {
    flex: none;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-xs);
    color: var(--text-tertiary);
    transition: all var(--dur-fast) var(--ease-out);
}

.toast-close:hover { background: var(--surface-hover); color: var(--text); }

.toast.is-leaving {
    animation: toast-out var(--dur-base) var(--ease-out) both;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px) scale(0.94); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(40px) scale(0.94); }
}

/* ────────────────────────────────────────────────────────────
   Modal
   ──────────────────────────────────────────────────────────── */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-backdrop);
    background: rgba(8, 8, 14, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    padding: var(--space-4);
    animation: fade-in var(--dur-base) var(--ease-out) both;
    overflow-y: auto;
}

.modal {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100dvh - 48px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modal-in var(--dur-slow) var(--ease-spring) both;
}

.modal-sm { width: min(420px, 100%); }
.modal-lg { width: min(760px, 100%); }

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-6) var(--space-4);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-tight);
}

.modal-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: 4px;
}

.modal-body {
    padding: 0 var(--space-6) var(--space-6);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

.modal-footer .btn { flex: 1; }

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ────────────────────────────────────────────────────────────
   Dropdown
   ──────────────────────────────────────────────────────────── */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    padding: var(--space-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-drawer);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition: all var(--dur-base) var(--ease-out);
}

.dropdown.is-open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-menu.to-left { right: auto; left: 0; transform-origin: top left; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--text);
    text-align: left;
    transition: background-color var(--dur-fast) var(--ease-out);
}

.dropdown-item:hover { background: var(--surface-hover); color: var(--text); }
.dropdown-item .ico { width: 17px; height: 17px; color: var(--text-tertiary); }
.dropdown-item.is-danger { color: var(--danger-text); }
.dropdown-item.is-danger .ico { color: var(--danger-text); }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-2) 0;
}

.dropdown-label {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--text-tertiary);
}

/* ────────────────────────────────────────────────────────────
   Tabs
   ──────────────────────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-out);
}

.tab::after {
    content: "";
    position: absolute;
    left: var(--space-3);
    right: var(--space-3);
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand);
    transform: scaleX(0);
    transition: transform var(--dur-base) var(--ease-out);
}

.tab:hover { color: var(--text); }

.tab.is-active {
    color: var(--text);
    font-weight: var(--weight-semibold);
}

.tab.is-active::after { transform: scaleX(1); }

.tab-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--surface-3);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    color: var(--text-secondary);
}

.tab.is-active .tab-count {
    background: var(--brand-soft);
    color: var(--brand-text);
}

/* ────────────────────────────────────────────────────────────
   Progress
   ──────────────────────────────────────────────────────────── */

.progress {
    height: 8px;
    background: var(--surface-3);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--gradient-brand);
    transition: width var(--dur-slower) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    animation: shimmer 1.8s linear infinite;
}

.progress-sm { height: 5px; }

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* ────────────────────────────────────────────────────────────
   Skeleton
   ──────────────────────────────────────────────────────────── */

.skeleton {
    background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-hover) 50%, var(--surface-3) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    animation: skeleton 1.4s ease-in-out infinite;
}

@keyframes skeleton {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ────────────────────────────────────────────────────────────
   Bo'sh holat
   ──────────────────────────────────────────────────────────── */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-16) var(--space-6);
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: var(--space-5);
    border-radius: var(--radius-xl);
    background: var(--gradient-brand-soft);
    color: var(--brand);
}

.empty-icon .ico { width: 30px; height: 30px; stroke-width: 1.6; }

.empty-title {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-2);
}

.empty-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    max-width: 380px;
    margin-bottom: var(--space-6);
    line-height: var(--leading-relaxed);
}

/* ────────────────────────────────────────────────────────────
   Statistika kartasi
   ──────────────────────────────────────────────────────────── */

.stat {
    position: relative;
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: transform var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out);
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.stat-label {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--brand);
    flex: none;
}

.stat-icon .ico { width: 17px; height: 17px; }

.stat-icon.tone-success { background: var(--success-soft); color: var(--success); }
.stat-icon.tone-warning { background: var(--warning-soft); color: var(--warning); }
.stat-icon.tone-danger  { background: var(--danger-soft);  color: var(--danger); }
.stat-icon.tone-info    { background: var(--info-soft);    color: var(--info); }
.stat-icon.tone-muted   { background: var(--surface-3);    color: var(--text-tertiary); }

.stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-tighter);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-value small {
    font-size: var(--text-md);
    font-weight: var(--weight-medium);
    color: var(--text-tertiary);
    letter-spacing: var(--tracking-normal);
}

.stat-meta {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-trend-up   { color: var(--success-text); }
.stat-trend-down { color: var(--danger-text); }

/* ────────────────────────────────────────────────────────────
   Timeline
   ──────────────────────────────────────────────────────────── */

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-6);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -30px;
    top: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text-tertiary);
}

.timeline-dot .ico { width: 13px; height: 13px; }

.timeline-item.is-done .timeline-dot {
    background: var(--success-soft);
    border-color: var(--success);
    color: var(--success);
}

.timeline-item.is-active .timeline-dot {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}

.timeline-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    margin-bottom: 2px;
}

.timeline-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-snug);
}

.timeline-time {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ────────────────────────────────────────────────────────────
   Reyting yulduzlari
   ──────────────────────────────────────────────────────────── */

.stars {
    display: inline-flex;
    gap: 2px;
    color: #f5a623;
}

.stars .ico {
    width: 15px;
    height: 15px;
    fill: none;
    stroke-width: 1.8;
}

.stars .ico.is-filled { fill: currentColor; }

.stars-lg .ico { width: 20px; height: 20px; }

.stars-input {
    display: inline-flex;
    gap: var(--space-1);
    direction: rtl;
}

.stars-input input { display: none; }

.stars-input label {
    cursor: pointer;
    color: var(--border-strong);
    transition: color var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-spring);
}

.stars-input label .ico { width: 28px; height: 28px; stroke-width: 1.6; }

.stars-input label:hover,
.stars-input label:hover ~ label,
.stars-input input:checked ~ label {
    color: #f5a623;
}

.stars-input input:checked ~ label .ico { fill: currentColor; }
.stars-input label:hover { transform: scale(1.12); }

/* ────────────────────────────────────────────────────────────
   Ogohlantirish bloki
   ──────────────────────────────────────────────────────────── */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface-3);
    border: 1px solid var(--border);
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
}

.alert .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; }

.alert-title { font-weight: var(--weight-semibold); margin-bottom: 3px; }

.alert-brand   { background: var(--brand-soft);   border-color: transparent; color: var(--brand-text); }
.alert-success { background: var(--success-soft); border-color: transparent; color: var(--success-text); }
.alert-warning { background: var(--warning-soft); border-color: transparent; color: var(--warning-text); }
.alert-danger  { background: var(--danger-soft);  border-color: transparent; color: var(--danger-text); }
.alert-info    { background: var(--info-soft);    border-color: transparent; color: var(--info-text); }

/* ────────────────────────────────────────────────────────────
   Sahifalash
   ──────────────────────────────────────────────────────────── */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    flex-wrap: wrap;
    padding: var(--space-6) 0 0;
}

.page-link {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    transition: all var(--dur-fast) var(--ease-out);
}

.page-link:hover { background: var(--surface-hover); color: var(--text); }

.page-link.is-active {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-brand);
}

.page-link.is-disabled { opacity: 0.4; pointer-events: none; }

.page-dots {
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 38px;
    color: var(--text-tertiary);
}

/* ────────────────────────────────────────────────────────────
   Tooltip
   ──────────────────────────────────────────────────────────── */

[data-tip] { position: relative; }

[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 10px;
    background: var(--text);
    color: var(--bg);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-xs);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--dur-fast) var(--ease-out);
    z-index: var(--z-sticky);
}

[data-tip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
