#ht-user-activity[hidden],
.ht-audit-filter[hidden] {
    display: none !important;
}

#ht-user-activity {
    height: 36px;
    white-space: nowrap;
    font-size: 13px;
    padding: 6px 12px;
}

.ht-audit-dialog {
    width: min(1500px, 96vw);
    max-width: 96vw;
    max-height: 90vh;
    padding: 20px;
    border: 1px solid var(--ht-border, #94a3b8);
    border-radius: 12px;
    background: var(--ht-panel, #fff);
    color: var(--ht-text, #172033);
    box-shadow: 0 20px 70px #0007;
}

html[data-hamtalk-theme="dark"] .ht-audit-dialog {
    background: #172e49;
    color: #f1f5f9;
}

.ht-audit-dialog::backdrop {
    background: rgba(0,0,0,.65);
}

.ht-audit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.ht-audit-header h2 {
    font-size: 23px;
    font-weight: 750;
    margin: 0;
}

.ht-audit-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(130px,1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.ht-audit-stat {
    padding: 12px;
    border: 1px solid #94a3b877;
    border-radius: 8px;
    background: #94a3b818;
}

.ht-audit-stat span {
    display: block;
    font-size: 12px;
}

.ht-audit-stat strong {
    display: block;
    font-size: 30px;
}

.ht-audit-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ht-audit-action,
.ht-audit-search,
.ht-audit-filter {
    background: var(--ht-panel, #fff);
    color: inherit;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    padding: 8px 12px;
}

.ht-audit-action {
    cursor: pointer;
    font-weight: 600;
}

.ht-audit-action:hover,
.ht-audit-action.selected {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.ht-audit-search {
    flex: 1 1 240px;
    min-width: 0;
}

.ht-audit-table-wrap {
    max-height: 52vh;
    overflow: auto;
    border: 1px solid #94a3b866;
    border-radius: 6px;
}

.ht-audit-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ht-audit-table-wrap th,
.ht-audit-table-wrap td {
    padding: 10px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #94a3b844;
}

.ht-audit-table-wrap th {
    position: sticky;
    top: 0;
    background: #294968;
    color: white;
    z-index: 1;
}

.ht-audit-table-wrap tr:nth-child(even) {
    background: #94a3b811;
}

.ht-audit-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 11px;
}

.ht-audit-dialog .good {
    color: #15803d;
}

.ht-audit-dialog .bad {
    color: #dc2626;
}

html[data-hamtalk-theme="dark"] .ht-audit-dialog .good {
    color: #4ade80;
}

html[data-hamtalk-theme="dark"] .ht-audit-dialog .bad {
    color: #f87171;
}

.ht-audit-status.good {
    background: #22c55e22;
}

.ht-audit-status.bad {
    background: #ef444422;
}

.ht-audit-status.muted {
    background: #94a3b833;
}

.ht-audit-message {
    margin-top: 12px;
    font-size: 12px;
    opacity: .8;
}

@media(max-width:767px) {
    .ht-audit-dialog {
        padding: 12px;
    }

    .ht-audit-header h2 {
        font-size: 18px;
    }

    .ht-audit-table-wrap {
        max-height: 40vh;
    }

    #ht-header-auth {
        flex-wrap: wrap;
    }
}


#ht-audit-clear {
    background: #b91c1c !important;
    border-color: #dc2626 !important;
    color: white !important;
    margin-left: auto;
}

#ht-audit-clear:hover {
    background: #991b1b !important;
}

#ht-audit-clear:disabled {
    opacity: .5;
    cursor: wait;
}
