:root {
    --milk-blue-900: #0b3f98;
    --milk-blue-800: #0e4eb8;
    --milk-blue-700: #1260d0;
    --milk-blue-600: #1a71df;
    --milk-blue-100: #e8f1ff;
}

.brand-logo-text {
    display: flex;
    flex-direction: column;
    color: #ffffff;
    text-decoration: none;
}

.brand-logo-text:hover {
    color: #ffffff;
    text-decoration: none;
}

.brand-logo-text__title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-logo-text__subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    opacity: 0.8;
}

.mobile-logout-btn {
    width: 38px;
    height: 38px;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-aside-user {
    margin-top: auto;
    padding: 0.9rem 1rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(5, 35, 85, 0.18);
}

.mobile-aside-user__button {
    width: 100%;
    border: 0;
    border-radius: 0.75rem;
    padding: 0.72rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
}

.mobile-aside-user__button:hover,
.mobile-aside-user__button:focus {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    outline: none;
}

.mobile-aside-user__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    background: #e8f1ff;
    color: var(--milk-blue-800);
    font-weight: 700;
}

.mobile-aside-user__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.mobile-aside-user__name {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    font-size: 0.95rem;
}

.mobile-aside-user__role {
    margin-top: 0.18rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.78rem;
}

.mobile-aside-user__menu {
    min-width: 220px;
    border: 0;
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(8, 31, 68, 0.22);
}

/* Yon panel yopilganda brand matnini yashirish */
.aside-minimize:not(.aside-minimize-hover) .brand-logo-text__title,
.aside-minimize:not(.aside-minimize-hover) .brand-logo-text__subtitle {
    display: none;
}

.aside-minimize:not(.aside-minimize-hover) .brand-logo-text {
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

.menu-icon i {
    width: 18px;
    text-align: center;
}

.btn.btn-primary,
.btn-primary {
    background-color: var(--milk-blue-700);
    border-color: var(--milk-blue-700);
}

.btn.btn-primary:hover,
.btn-primary:hover,
.btn.btn-primary:focus,
.btn-primary:focus {
    background-color: var(--milk-blue-800);
    border-color: var(--milk-blue-800);
}

.btn.btn-light-primary {
    color: var(--milk-blue-700);
    background-color: var(--milk-blue-100);
    border-color: transparent;
}

.btn.btn-light-primary:hover {
    color: #ffffff;
    background-color: var(--milk-blue-700);
}

#kt_subheader {
    display: none !important;
}

.header-page-actions {
    align-items: center;
    gap: 0.55rem;
}

.header-page-actions .btn {
    min-height: 34px !important;
    padding: 0.25rem 0.8rem !important;
    font-size: 0.85rem !important;
}

#kt_header .topbar .topbar-user-btn {
    min-height: 38px !important;
    height: 38px !important;
    padding: 0.2rem 0.8rem !important;
    font-size: 0.9rem !important;
    border-radius: 0.45rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

#kt_header .topbar {
    display: flex !important;
    align-items: center !important;
    align-self: center !important;
    height: 100% !important;
}

#kt_header .topbar .dropdown {
    display: flex;
    align-items: center;
    height: 100%;
}

.content-wrapper .btn.btn-sm,
.content-wrapper .btn.btn-xs {
    min-height: 36px;
    padding: 0.38rem 0.8rem;
    font-size: 0.92rem;
}

.dashboard-page .card-header,
.reports-page .card-header {
    border-bottom: 0 !important;
}

.reports-page > .row + .row {
    margin-top: 0.55rem;
}

.reports-page .card-body.data-scroll-box {
    padding-bottom: 1.35rem !important;
}

.reports-page .reports-equal-row > [class*="col-"] {
    display: flex;
}

.reports-page .reports-equal-row > [class*="col-"] > .card {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.reports-page .reports-equal-row .card-body.data-scroll-box {
    flex: 1 1 auto;
    min-height: 0;
}

.summary-equal-row {
    row-gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.summary-equal-row > [class*="col-"] {
    display: flex;
}

.summary-equal-row > [class*="col-"] > .card {
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    display: flex;
}

.summary-equal-row + .card.card-custom.gutter-b,
.summary-equal-row + .row {
    margin-top: 0.6rem;
}

.summary-equal-row .card.gutter-b {
    margin-bottom: 0.75rem !important;
}

.summary-equal-row .card .card-body {
    padding: 0.56rem 0.88rem !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0 !important;
    gap: 0.08rem;
}

.summary-equal-row .card .card-body > .dashboard-stat__label:first-child {
    min-height: 0;
    line-height: 1.22;
    margin-bottom: 0;
}

.summary-equal-row .dashboard-stat__value {
    font-size: 1.95rem;
    line-height: 1.08;
    margin-bottom: 0 !important;
}

.summary-equal-row .summary-card-hint {
    display: none !important;
}

.summary-equal-row .card .card-body > .text-muted.mt-2 {
    display: none !important;
}

.summary-equal-row .card .card-body > .text-muted {
    display: none !important;
}

.summary-equal-row + .list-filter-card .card-body {
    padding-top: 0.95rem !important;
    padding-bottom: 0.45rem !important;
}

.summary-equal-row--tight .card .card-body {
    padding: 0.5rem 0.82rem !important;
    min-height: 0 !important;
}

.summary-equal-row--tight .dashboard-stat__value {
    font-size: 1.65rem;
}

.dashboard-page > .row + .row {
    margin-top: 0.35rem;
}

.dashboard-page .card.gutter-b {
    margin-bottom: 1.6rem !important;
}

.dashboard-page .card-body.data-scroll-box {
    padding-bottom: 1.4rem !important;
}

.dashboard-page .dashboard-equal-row > [class*="col-"] {
    display: flex;
}

.dashboard-page .dashboard-equal-row > [class*="col-"] > .card {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-page .dashboard-equal-row > [class*="col-"] > .card .card-body.data-scroll-box {
    flex: 1 1 auto;
    min-height: 0;
}

.dashboard-page .dashboard-balance-row .dashboard-stack-col .dashboard-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dashboard-page .dashboard-balance-row .dashboard-stack-col .dashboard-stack .card.gutter-b {
    margin-bottom: 0 !important;
}

.dashboard-page .dashboard-equal-row {
    row-gap: 2rem;
    margin-bottom: 2rem;
}

.dashboard-page .dashboard-equal-row + .dashboard-equal-row,
.dashboard-page .dashboard-equal-row + .row {
    margin-top: 0;
}

.data-scroll-box {
    max-height: 340px;
    overflow-y: auto;
    overflow-x: hidden;
}

.data-scroll-box::-webkit-scrollbar {
    width: 8px;
}

.data-scroll-box::-webkit-scrollbar-thumb {
    background: rgba(11, 63, 152, 0.3);
    border-radius: 999px;
}

#kt_header_mobile,
#kt_aside,
#kt_brand,
#kt_aside_menu_wrapper,
#kt_aside_menu {
    background: linear-gradient(180deg, var(--milk-blue-900) 0%, #0a3a8a 55%, #083478 100%) !important;
}

.menu-section .menu-text,
.aside .menu-nav > .menu-item > .menu-link .menu-text,
.aside .menu-nav > .menu-item > .menu-link .menu-icon i {
    color: rgba(255, 255, 255, 0.86) !important;
}

.aside .menu-nav > .menu-item.menu-item-active > .menu-link,
.aside .menu-nav > .menu-item.menu-item-open > .menu-link,
.aside .menu-nav > .menu-item:hover > .menu-link {
    background: rgba(26, 113, 223, 0.35) !important;
}

.aside .menu-nav > .menu-item .menu-submenu .menu-item.menu-item-active > .menu-link {
    background: rgba(26, 113, 223, 0.28) !important;
}

.burger-icon span,
.burger-icon span::before,
.burger-icon span::after {
    background-color: #ffffff !important;
}

.login.login-1 .login-aside {
    background-image: linear-gradient(160deg, #1e8ef9 0%, var(--milk-blue-700) 45%, var(--milk-blue-900) 100%) !important;
    background-color: var(--milk-blue-800) !important;
}

.login.login-1 .login-brand__copy {
    color: rgba(255, 255, 255, 0.92);
}

.content-wrapper .form-control,
.content-wrapper .custom-select,
.content-wrapper .btn {
    font-size: 1.08rem;
}

.content-wrapper .form-control,
.content-wrapper .custom-select {
    min-height: 58px;
}

.content-wrapper .btn {
    min-height: 54px;
    padding-left: 1.55rem;
    padding-right: 1.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.content-wrapper .btn.btn-sm,
.content-wrapper .btn.btn-xs {
    justify-content: center !important;
    text-align: center !important;
    line-height: 1.15 !important;
}

.content-wrapper label,
.content-wrapper .table th,
.content-wrapper .table td,
.content-wrapper .text-muted,
.content-wrapper .menu-text {
    font-size: 1.04rem;
}

.content-wrapper .card-title {
    font-size: 1.28rem;
}

.dashboard-stat__value {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
}

.dashboard-stat__value-secondary {
    font-size: 1.6rem;
}

.dashboard-stat__label {
    color: #7e8299;
    font-size: 0.85rem;
}

.quick-metric {
    border-radius: 0.85rem;
    padding: 1.25rem;
    height: 100%;
}

.quick-metric--success {
    background: linear-gradient(135deg, rgba(54, 153, 255, 0.12), rgba(27, 197, 189, 0.18));
}

.quick-metric--warning {
    background: linear-gradient(135deg, rgba(255, 168, 0, 0.12), rgba(246, 78, 96, 0.14));
}

.quick-metric--milk {
    background: linear-gradient(135deg, rgba(44, 123, 229, 0.12), rgba(255, 248, 220, 0.65));
}

.quick-metric--dark {
    background: linear-gradient(135deg, rgba(24, 28, 50, 0.08), rgba(62, 67, 106, 0.16));
}

.table thead th {
    white-space: nowrap;
}

.content-wrapper .table thead tr.text-uppercase th {
    text-transform: none !important;
    letter-spacing: normal;
}

.table td,
.table th {
    vertical-align: middle;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.content-wrapper {
    min-height: calc(100vh - 70px);
}

.login-brand {
    max-width: 360px;
}

.login-brand__title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.login-brand__copy {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
}

.login-hero-brand {
    font-size: clamp(2.4rem, 6.2vw, 4.9rem);
    line-height: 0.95;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.98);
    text-shadow: 0 10px 28px rgba(7, 28, 66, 0.35);
    max-width: 12ch;
}

@media (max-width: 991.98px) {
    .login-hero-brand {
        font-size: clamp(2rem, 9vw, 3.1rem);
        max-width: 100%;
    }
}

.info-strip {
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;
    background: #f3f6f9;
}

.list-filter-card .card-body {
    padding-top: 1.25rem !important;
    padding-bottom: 0.75rem;
}

.filter-toolbar .form-group {
    margin-bottom: 0.45rem;
}

.filter-toolbar .row {
    row-gap: 0.1rem;
}

.filter-toolbar label {
    display: block;
    margin-bottom: 0.28rem;
    font-weight: 600;
    color: #3f4254;
    font-size: 0.96rem;
}

.list-filter-card .form-control {
    min-height: 48px;
    height: 48px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.filter-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    gap: 0.75rem;
    margin-top: 0;
}

.filter-toolbar__actions .btn {
    margin-right: 0 !important;
    min-height: 48px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.filter-actions-col {
    display: flex;
    align-items: flex-end;
}

.filter-actions-col .filter-toolbar__actions {
    width: auto;
    margin-bottom: 0.45rem;
}

.filter-toolbar--compact-grid .sales-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem 0.9rem;
    align-items: end;
}

.filter-toolbar--compact-grid .sales-filter-grid .form-group:first-child {
    grid-column: span 2;
}

.filter-toolbar--compact-grid .sales-filter-grid .form-group {
    margin-bottom: 0;
}

.filter-toolbar--compact-grid .sales-filter-actions {
    display: flex;
    align-items: flex-end;
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.filter-toolbar--compact-grid .sales-filter-actions .filter-toolbar__actions {
    width: auto;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.filter-toolbar__actions .btn-filter-clear {
    background: #eaf1ff !important;
    border: 1px solid #c8d8ff !important;
    color: #1f5fbf !important;
}

.filter-toolbar__actions .btn-filter-clear:hover,
.filter-toolbar__actions .btn-filter-clear:focus {
    background: #dce9ff !important;
    border-color: #b6cbff !important;
    color: #174f9f !important;
}

@media (max-width: 991.98px) {
    .filter-toolbar__actions {
        justify-content: flex-start;
    }

    .filter-toolbar--compact-grid .sales-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-toolbar--compact-grid .sales-filter-grid .form-group:first-child {
        grid-column: 1 / -1;
    }

    .filter-toolbar--compact-grid .sales-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .filter-toolbar--compact-grid .sales-filter-actions .filter-toolbar__actions {
        flex-wrap: wrap;
    }
}

.filter-toolbar .filter-date-col {
    flex: 0 0 220px;
    max-width: 220px;
}

.filter-toolbar .filter-date-col label {
    white-space: nowrap;
}

.filter-toolbar .filter-date-col input[type="date"] {
    min-width: 200px;
}

@media (max-width: 575.98px) {
    .filter-toolbar .filter-date-col {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .filter-toolbar .filter-date-col input[type="date"] {
        min-width: 0;
    }

    .filter-toolbar--compact-grid .sales-filter-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 992px) and (max-width: 1599.98px) {
    .filter-toolbar--compact-grid .sales-filter-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .filter-toolbar--compact-grid .sales-filter-grid .form-group:first-child {
        grid-column: span 2;
    }

    .filter-toolbar--compact-grid .sales-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

.receipt-paper {
    max-width: 920px;
    margin: 0 auto;
}

.empty-state {
    padding: 2rem;
    border: 1px dashed #d1d3e0;
    border-radius: 0.75rem;
    text-align: center;
    color: #7e8299;
}

.form-grid-card .form-group label {
    font-weight: 600;
    color: #3f4254;
}

.form-grid-card .card-body {
    padding: 2rem;
}

.form-grid-card .form-group {
    margin-bottom: 1.6rem;
}

.checkbox-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 74px;
    padding: 1rem 1.25rem;
    border: 1px solid #e4e6ef;
    border-radius: 0.9rem;
    background: #f8fafc;
}

.checkbox-tile__label {
    font-size: 1.06rem;
    font-weight: 600;
    color: #3f4254;
}

.checkbox-tile__help {
    margin-top: 0.25rem;
    color: #7e8299;
    font-size: 0.96rem;
}

.checkbox-tile__control {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.checkbox-tile__control input[type="checkbox"] {
    width: 1.45rem;
    height: 1.45rem;
    accent-color: #3699ff;
}

.document-line-table .form-control {
    min-width: 170px;
    min-height: 60px;
    font-size: 1.1rem;
}

.document-line-table {
    width: 100%;
    table-layout: fixed;
}

.document-line-table th.col-product,
.document-line-table td.col-product {
    width: 52%;
}

.document-line-table th.col-qty,
.document-line-table td.col-qty {
    width: 18%;
}

.document-line-table th.col-price,
.document-line-table td.col-price {
    width: 22%;
}

.document-line-table th.col-remove,
.document-line-table td.col-remove {
    width: 8%;
}

.document-line-table--no-price th.col-product,
.document-line-table--no-price td.col-product {
    width: 68%;
}

.document-line-table--no-price th.col-qty,
.document-line-table--no-price td.col-qty {
    width: 24%;
}

.document-line-table--no-price th.col-remove,
.document-line-table--no-price td.col-remove {
    width: 8%;
}

.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single {
    min-height: 58px !important;
    border: 1px solid #e4e6ef !important;
    border-radius: 0.42rem !important;
    background: #f3f6f9 !important;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 56px !important;
    padding-left: 1rem !important;
    color: #3f4254 !important;
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: 56px !important;
    right: 8px !important;
}

.select2-dropdown {
    border: 1px solid #d7dbe8 !important;
    border-radius: 0.55rem !important;
}

.select2-search__field {
    min-height: 40px;
}

.list-filter-card .select2-container .select2-selection--single {
    min-height: 48px !important;
}

.list-filter-card .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 46px !important;
}

.list-filter-card .select2-container .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
}

.document-line-table td {
    vertical-align: top;
}

.document-form-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.metric-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.metric-card-link:hover,
.metric-card-link:focus {
    color: inherit;
    text-decoration: none;
}

.dashboard-clickable-card {
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.dashboard-clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 53, 86, 0.12);
}

.dashboard-page > .row:first-child .card.card-custom {
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0.85rem !important;
    background: transparent !important;
}

.dashboard-page > .row:first-child .card.card-custom .card-body.quick-metric {
    border-radius: 0.85rem !important;
    overflow: hidden !important;
}

.dashboard-page > .row:first-child .card.card-custom::before,
.dashboard-page > .row:first-child .card.card-custom::after,
.dashboard-page > .row:first-child .card.card-custom .card-body.quick-metric::before,
.dashboard-page > .row:first-child .card.card-custom .card-body.quick-metric::after {
    display: none !important;
    content: none !important;
}

.telegram-timeline-scroll {
    max-height: 540px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.35rem;
}

.telegram-timeline-scroll .timeline-content {
    white-space: normal;
    word-break: break-word;
}

.pagination-toolbar {
    margin-top: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pagination-toolbar .pagination .page-link {
    min-width: 46px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    padding: 0.5rem 0.8rem;
}

.pagination-toolbar .page-item.active .page-link {
    font-weight: 700;
}

/* ----------------------------------------------------
   Permissions Grid (Ruxsatlar uchun multi-column)
---------------------------------------------------- */
.permissions-grid #id_permissions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.permissions-group-card {
    border: 1px solid #d7dbe8;
    border-radius: 0.85rem;
    background: #fff;
    overflow: hidden;
}

.permissions-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0;
    background: #f3f6f9;
    border-bottom: 1px solid #e4e6ef;
    cursor: pointer;
}

.permissions-group-master {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.permissions-group-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.permissions-group-items {
    display: grid;
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    gap: 10px 14px;
    padding: 0.95rem 1rem 1rem;
}

.permissions-group-items label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    cursor: pointer;
    font-size: 0.95rem;
    word-break: break-word;
}

.permissions-group-items input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

@media (max-width: 992px) {
    .permissions-group-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .permissions-group-items {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------------
   Mobile layout: desktop qoidalariga tegmasdan faqat kichik ekranlar
---------------------------------------------------- */
@media (max-width: 991.98px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body.header-mobile-fixed {
        padding-top: 56px !important;
    }

    #kt_header_mobile {
        min-height: 56px;
        height: 56px;
        padding: 0 0.9rem;
    }

    #kt_aside {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
    }

    #kt_aside_menu_wrapper {
        flex: 1 1 auto !important;
        min-height: 0;
        overflow-y: auto;
    }

    #kt_header_mobile .brand-logo-text__title {
        font-size: 1rem;
        letter-spacing: 0.05em;
    }

    #kt_header {
        display: none !important;
    }

    #kt_wrapper {
        width: 100% !important;
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    .page,
    #kt_wrapper,
    #kt_content {
        min-width: 0 !important;
    }

    .mobile-page-heading {
        background: #ffffff;
        border-radius: 0.75rem;
        padding: 0.85rem 1rem;
        margin: 0.85rem 0;
        box-shadow: 0 8px 22px rgba(36, 53, 86, 0.06);
    }

    .mobile-page-heading__date {
        display: block;
        color: #b5b5c3;
        font-size: 0.8rem;
        line-height: 1.1;
    }

    .mobile-page-heading__title {
        margin: 0.15rem 0 0;
        color: #181c32;
        font-size: 1.22rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .mobile-page-heading__actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.62rem;
    }

    .mobile-page-toggle-btn {
        min-height: 34px !important;
        padding: 0.35rem 0.8rem !important;
        font-size: 0.86rem !important;
        border-radius: 999px !important;
        border: 1px solid #d6e4ff !important;
        background: #f1f6ff !important;
        color: #1a5fc4 !important;
    }

    .mobile-page-toggle-btn.is-active {
        background: #1a5fc4 !important;
        border-color: #1a5fc4 !important;
        color: #ffffff !important;
    }

    .mobile-collapsible-target.mobile-collapsed {
        display: none !important;
    }

    #kt_content.content-wrapper {
        min-height: auto;
        padding-top: 0 !important;
    }

    .content-wrapper .container-fluid {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    .content-wrapper .card.card-custom {
        border-radius: 0.75rem;
        height: auto !important;
        min-height: 0;
        overflow: visible !important;
    }

    .content-wrapper .card.card-stretch {
        height: auto !important;
    }

    .content-wrapper .card.gutter-b {
        margin-bottom: 0.95rem !important;
    }

    .content-wrapper .card-header {
        min-height: auto;
        padding: 1rem 1rem 0.65rem !important;
        gap: 0.65rem;
        flex-wrap: wrap;
    }

    .content-wrapper .card-body {
        padding: 1rem !important;
        min-height: 0;
    }

    .content-wrapper .card-title {
        font-size: 1.12rem;
        line-height: 1.25;
    }

    .content-wrapper .form-control,
    .content-wrapper .custom-select,
    .content-wrapper .btn {
        font-size: 1rem;
    }

    .content-wrapper .form-control,
    .content-wrapper .custom-select {
        min-height: 46px;
        height: 46px;
    }

    .content-wrapper textarea.form-control {
        height: auto;
        min-height: 110px;
    }

    .content-wrapper .btn {
        min-height: 46px;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .dashboard-stat__value {
        font-size: 1.55rem;
        line-height: 1.18;
    }

    .dashboard-stat__value-secondary {
        font-size: 1.35rem;
    }

    .dashboard-stat__label {
        font-size: 0.82rem;
    }

    .quick-metric {
        min-height: 92px;
        padding: 0.75rem 0.85rem 0.78rem;
        overflow: visible !important;
    }

    .summary-equal-row .card.card-custom,
    .dashboard-page > .row:first-child .card.card-custom {
        min-height: 92px;
    }

    .quick-metric .text-muted,
    .summary-equal-row .text-muted,
    .content-wrapper .card .text-muted {
        white-space: normal;
        overflow: visible;
        line-height: 1.35;
    }

    .dashboard-page > .row:first-child .card.card-custom,
    .dashboard-page > .row:first-child .card.card-custom .card-body.quick-metric {
        overflow: visible !important;
    }

    .summary-equal-row .card .card-body,
    .products-page .card .card-body,
    .warehouse-page .card .card-body,
    .returns-page .card .card-body,
    .return-warehouse-page .card .card-body,
    .sales-page .card .card-body,
    .cash-page .card .card-body,
    .shop-sales-page .card .card-body {
        padding-bottom: 0.78rem !important;
    }

    .summary-equal-row,
    .dashboard-page .dashboard-equal-row,
    .reports-page .reports-equal-row {
        row-gap: 0;
        margin-bottom: 0.25rem;
    }

    .summary-equal-row > [class*="col-"],
    .dashboard-page > .row > [class*="col-"],
    .reports-page > .row > [class*="col-"],
    .customer-detail-page > .row > [class*="col-"],
    .product-detail-page > .row > [class*="col-"] {
        margin-bottom: 0.95rem;
    }

    .dashboard-page .dashboard-balance-row .dashboard-stack-col .dashboard-stack {
        gap: 0.95rem;
    }

    .data-scroll-box {
        max-height: 360px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .list-filter-card .card-body {
        padding: 0.85rem !important;
    }

    .filter-toolbar .row {
        row-gap: 0.55rem;
    }

    .filter-toolbar .form-group {
        margin-bottom: 0;
    }

    .filter-toolbar label {
        font-size: 0.88rem;
        margin-bottom: 0.22rem;
    }

    .filter-toolbar .row > [class*="col-"]:not(.filter-date-col):not(.filter-actions-col) {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .filter-toolbar .filter-date-col {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .filter-toolbar .filter-date-col input[type="date"] {
        min-width: 0;
    }

    .filter-actions-col {
        flex: 0 0 100%;
        max-width: 100%;
        align-items: stretch;
    }

    .filter-actions-col .filter-toolbar__actions {
        width: 100%;
        margin-bottom: 0;
    }

    .filter-toolbar__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        width: 100%;
        justify-content: stretch;
    }

    .filter-toolbar__actions .btn {
        width: 100%;
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }

    .filter-toolbar--compact-grid .sales-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .filter-toolbar--compact-grid .sales-filter-grid .form-group:first-child {
        grid-column: 1 / -1;
    }

    .filter-toolbar--compact-grid .sales-filter-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .filter-toolbar--compact-grid .sales-filter-actions .filter-toolbar__actions {
        width: 100%;
        flex-wrap: nowrap;
    }

    .list-filter-card .form-control,
    .list-filter-card .custom-select,
    .list-filter-card .select2-container .select2-selection--single {
        min-height: 44px !important;
        height: 44px !important;
    }

    .list-filter-card .select2-container .select2-selection--single .select2-selection__rendered {
        line-height: 42px !important;
    }

    .list-filter-card .select2-container .select2-selection--single .select2-selection__arrow {
        height: 42px !important;
    }

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

    .table-responsive > .table {
        min-width: 720px;
    }

    .table td,
    .table th {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .document-line-table .form-control,
    .document-line-table .select2-container .select2-selection--single {
        min-height: 48px !important;
    }

    .document-line-table .select2-container .select2-selection--single .select2-selection__rendered {
        line-height: 46px !important;
    }

    .document-line-table .select2-container .select2-selection--single .select2-selection__arrow {
        height: 46px !important;
    }

    .document-line-table {
        min-width: 0;
        table-layout: auto;
    }

    .document-line-table thead {
        display: none;
    }

    .document-line-table,
    .document-line-table tbody,
    .document-line-table tr,
    .document-line-table td {
        display: block;
        width: 100% !important;
    }

    .document-line-table tr {
        position: relative;
        padding: 0.85rem;
        margin-bottom: 0.85rem;
        border: 1px solid #e4e6ef;
        border-radius: 0.75rem;
        background: #ffffff;
    }

    .document-line-table td {
        padding: 0 0 0.75rem !important;
    }

    .document-line-table td:last-child {
        padding-bottom: 0 !important;
    }

    .document-line-table td::before {
        display: block;
        margin-bottom: 0.3rem;
        color: #7e8299;
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .document-line-table td.col-product::before {
        content: "Mahsulot";
    }

    .document-line-table td.col-qty::before {
        content: "Soni";
    }

    .document-line-table td.col-price::before {
        content: "Narx";
    }

    .document-line-table td.col-remove::before {
        content: "O'chirish";
    }

    .document-line-table td.col-remove {
        text-align: left !important;
    }

    .document-line-table td.col-remove .btn {
        width: 46px;
        min-width: 46px;
        min-height: 42px;
        padding: 0;
    }

    .document-line-table .form-control,
    .document-line-table .select2-container {
        min-width: 0 !important;
        width: 100% !important;
    }

    .document-form-footer {
        flex-direction: column;
        align-items: stretch;
        margin-top: 1.4rem !important;
    }

    .document-form-footer > .d-flex {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .document-form-footer .btn {
        width: 100%;
        margin: 0 !important;
    }

    .form-grid-card .card-body {
        padding: 1rem !important;
    }

    .form-grid-card .form-group {
        margin-bottom: 1rem;
    }

    .checkbox-tile {
        min-height: 58px;
        padding: 0.8rem 0.9rem;
    }

    .customer-detail-page .card-body .d-flex.justify-content-end,
    .product-detail-page .card-body .d-flex.flex-wrap {
        justify-content: flex-start !important;
        gap: 0.55rem;
        margin-top: 0.75rem;
    }

    .customer-detail-page .card-body .d-flex.justify-content-end .btn,
    .product-detail-page .card-body .d-flex.flex-wrap .btn {
        width: 100%;
        margin: 0 !important;
    }

    .pagination-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-toolbar .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    .pagination-toolbar .pagination .page-link {
        min-width: 38px;
        min-height: 38px;
        font-size: 0.92rem;
    }

    #kt_footer .container-fluid {
        gap: 0.4rem;
        text-align: center;
    }

    .login.login-1 .login-aside {
        width: 100% !important;
        min-height: auto;
        padding: 1.5rem !important;
    }

    .login-brand {
        max-width: none;
    }

    .login-hero-brand {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem !important;
    }

    .login-brand__title {
        font-size: 1.55rem;
    }

    .login-brand__copy {
        font-size: 0.95rem;
    }

    .login-form {
        max-width: 100% !important;
    }
}

@media (max-width: 575.98px) {
    .content-wrapper .container-fluid {
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
    }

    .mobile-page-heading {
        margin: 0.65rem 0;
        padding: 0.75rem 0.85rem;
    }

    .mobile-page-heading__title {
        font-size: 1.08rem;
    }

    .content-wrapper .card-body {
        padding: 0.85rem !important;
    }

    .content-wrapper .card-header {
        padding: 0.85rem 0.85rem 0.55rem !important;
    }

    .filter-toolbar--compact-grid .sales-filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-toolbar .filter-date-col {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 7.5px;
        padding-right: 7.5px;
    }

    .filter-toolbar .filter-date-col input[type="date"] {
        padding-left: 0.65rem;
        padding-right: 0.45rem;
        font-size: 0.92rem;
    }

    .filter-toolbar__actions {
        grid-template-columns: 1fr;
    }

    .table-responsive > .table {
        min-width: 680px;
    }

    .content-wrapper .btn.btn-sm,
    .content-wrapper .btn.btn-xs {
        min-height: 34px;
        padding: 0.35rem 0.65rem;
        font-size: 0.88rem;
    }
}
