.bad-wrap,
.bad-mobile-dashboard {
    direction: rtl;
    box-sizing: border-box;
    max-width: 1280px;
    margin: 0 auto;
    overflow-x: hidden;
}

.bad-wrap *,
.bad-mobile-dashboard * {
    box-sizing: border-box;
}

.bad-mobile-dashboard {
    width: 100%;
    max-width: 100%;
    padding: 20px 16px;
    background: #f7f7f8;
}

.bad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 18px 0;
    text-align: right;
}

.bad-header h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 800;
    color: #444;
}

.bad-header p {
    margin: 8px 0 0;
    font-size: 16px;
    line-height: 1.5;
    color: #777;
}

.bad-filters {
    margin: 18px 0;
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.04);
}

.bad-filters label {
    font-weight: 800;
    color: #222;
}

.bad-filters select {
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 0 14px;
    height: 48px;
    font-size: 16px;
    background: #fff;
}

.bad-filters .button,
.bad-filters button {
    border-radius: 12px !important;
    height: 48px;
    padding: 0 22px !important;
    font-weight: 800;
}

.bad-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.bad-card {
    border: 0;
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(180deg,#fff,#fafafa);
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

.bad-card span {
    display: block;
    color: #7a7a7a;
    font-size: 15px;
    font-weight: 700;
}

.bad-card strong {
    display: block;
    color: #3c3c3c;
    font-size: 34px;
    margin-top: 10px;
    line-height: 1;
}

.bad-mobile-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 2px 18px;
    scrollbar-width: none;
}

.bad-mobile-nav::-webkit-scrollbar {
    display: none;
}

.bad-mobile-nav a {
    flex: 0 0 auto;
    text-decoration: none;
    background: #36322d;
    color: #fff !important;
    border-radius: 999px;
    padding: 10px 16px;
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
    font-weight: 800;
}

.bad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 20px 0;
}

.bad-panel {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 8px 26px rgba(0,0,0,.06);
    background: #fff;
    padding: 18px;
    margin: 20px 0;
}

.bad-panel h2 {
    color: #4f4f4f;
    font-weight: 900;
    font-size: 24px;
    margin: 0 0 18px;
}

.bad-list-cards,
.bad-recent-searches {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bad-list-card,
.bad-search-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fbfbfb;
    border: 1px solid #ededed;
    border-radius: 16px;
    padding: 14px;
}

.bad-list-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #f0f2f4;
    font-size: 20px;
}

.bad-list-main {
    min-width: 0;
    flex: 1;
}

.bad-list-label {
    display: block;
    color: #888;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 4px;
}

.bad-list-value {
    display: block;
    color: #444;
    font-size: 17px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.bad-list-count {
    flex: 0 0 auto;
    text-align: center;
    min-width: 58px;
    padding-right: 10px;
    border-right: 1px solid #e7e7e7;
}

.bad-list-count strong {
    display: block;
    font-size: 24px;
    color: #333;
    line-height: 1;
}

.bad-list-count span {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.bad-search-card {
    display: block;
}

.bad-search-time {
    color: #999;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.bad-search-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #eee;
}

.bad-search-line:first-of-type {
    border-top: 0;
}

.bad-search-line span {
    color: #888;
    font-weight: 800;
    flex: 0 0 42%;
}

.bad-search-line strong {
    color: #444;
    font-size: 16px;
    line-height: 1.35;
    text-align: left;
    overflow-wrap: anywhere;
}

.bad-empty {
    padding: 16px;
    color: #777;
    background: #fafafa;
    border-radius: 14px;
    text-align: center;
}

.bad-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bad-table-scroll table {
    min-width: 760px;
}

.bad-note,
.bad-public-error {
    margin: 20px 0;
    padding: 16px;
    border: 0;
    border-radius: 16px;
    background: #fff8e8;
    box-shadow: 0 6px 18px rgba(0,0,0,.04);
}

@media (max-width: 960px) {
    .bad-cards {
        grid-template-columns: 1fr 1fr;
    }
    .bad-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 782px) {
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .bad-mobile-dashboard,
    .bad-wrap {
        width: 100%;
        padding-left: 14px;
        padding-right: 14px;
        margin-left: 0;
        margin-right: 0;
    }

    .bad-header {
        display: block;
    }

    .bad-header h1 {
        font-size: 28px;
        text-align: right;
    }

    .bad-header p {
        font-size: 15px;
        text-align: right;
    }

    .bad-filters {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch;
    }

    .bad-filters select,
    .bad-filters button,
    .bad-filters .button {
        width: 100%;
        max-width: 100%;
        text-align: center;
        min-height: 44px;
    }

    .bad-cards {
        grid-template-columns: 1fr 1fr !important;
    }

    .bad-card {
        min-height: 112px;
    }

    .bad-card strong {
        font-size: 30px;
    }

    .bad-panel {
        padding: 16px;
        border-radius: 18px;
        margin: 14px 0;
    }

    .bad-panel h2 {
        font-size: 22px;
    }

    .bad-list-card {
        padding: 12px;
        gap: 10px;
    }

    .bad-list-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .bad-list-value {
        font-size: 16px;
    }

    .bad-list-count strong {
        font-size: 22px;
    }

    .bad-search-line {
        display: block;
    }

    .bad-search-line span {
        display: block;
        margin-bottom: 3px;
    }

    .bad-search-line strong {
        display: block;
        text-align: right;
    }
}

@media (max-width: 480px) {
    .bad-cards {
        grid-template-columns: 1fr !important;
    }
}
