﻿/* =========================================================
   MOB365 CONTROL CENTER — AUDIT LOGS
   ========================================================= */

.audit-page {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding-bottom: 48px;
    color: #0f172a;
}

.audit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.audit-eyebrow,
.audit-panel-kicker {
    display: block;
    color: #2563eb;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.audit-header h1 {
    margin: 8px 0 0;
    font-size: clamp(30px, 3vw, 43px);
    line-height: 1.1;
    font-weight: 950;
    letter-spacing: -.045em;
}

.audit-header p {
    max-width: 760px;
    margin: 10px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
}

.audit-refresh-button,
.audit-clear-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 850;
}

.audit-refresh-button {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 12px 24px rgba(37,99,235,.22);
}

.audit-clear-button {
    color: #334155;
    background: #f8fafc;
}

    .audit-refresh-button:disabled,
    .audit-clear-button:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

.audit-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: audit-spin .8s linear infinite;
}

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

.audit-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 15px 17px;
    border: 1px solid;
    border-radius: 15px;
}

.audit-alert-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    font-weight: 950;
}

.audit-alert strong {
    display: block;
    font-size: 13px;
}

.audit-alert p {
    margin: 4px 0 0;
    font-size: 12px;
}

.audit-alert.danger {
    color: #991b1b;
    border-color: #fecaca;
    background: #fff1f2;
}

    .audit-alert.danger .audit-alert-icon {
        background: #dc2626;
    }

.audit-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.audit-stat-card {
    display: flex;
    min-height: 110px;
    align-items: center;
    gap: 15px;
    padding: 19px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15,23,42,.055);
}

.audit-stat-icon {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border-radius: 14px;
    font-size: 20px;
}

.audit-stat-card.total .audit-stat-icon {
    color: #1d4ed8;
    background: #dbeafe;
}

.audit-stat-card.failed .audit-stat-icon,
.audit-stat-card.errors .audit-stat-icon {
    color: #b91c1c;
    background: #fee2e2;
}

.audit-stat-card.devices .audit-stat-icon {
    color: #047857;
    background: #d1fae5;
}

.audit-stat-card strong,
.audit-stat-card span {
    display: block;
}

.audit-stat-card strong {
    font-size: 28px;
    line-height: 1;
    font-weight: 950;
}

.audit-stat-card span {
    margin-top: 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
}

.audit-panel {
    margin-bottom: 22px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 21px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(15,23,42,.065);
}

.audit-filter-header,
.audit-table-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid #edf2f7;
}

    .audit-filter-header h2,
    .audit-table-header h2 {
        margin: 6px 0 0;
        font-size: 20px;
        font-weight: 900;
    }

    .audit-filter-header p,
    .audit-table-header p {
        margin: 7px 0 0;
        color: #64748b;
        font-size: 11px;
    }

.audit-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) minmax(180px, .7fr) minmax(160px, .6fr);
    gap: 12px;
    padding: 20px 24px 24px;
}

.audit-search {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    padding: 0 13px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #f8fafc;
}

    .audit-search input {
        width: 100%;
        border: 0;
        background: transparent;
        outline: none;
        font-family: inherit;
        font-size: 12px;
    }

.audit-select {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    color: #334155;
    background: #fff;
    outline: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 750;
}

.audit-loading,
.audit-empty {
    display: flex;
    min-height: 260px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 32px;
    text-align: center;
}

.audit-loader {
    width: 36px;
    height: 36px;
    border: 4px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: audit-spin .8s linear infinite;
}

.audit-empty {
    flex-direction: column;
}

.audit-empty-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 16px;
    background: #eef2ff;
    font-size: 22px;
}

.audit-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.audit-table {
    width: 100%;
    min-width: 1450px;
    border-collapse: collapse;
}

    .audit-table th {
        padding: 13px 14px;
        color: #64748b;
        background: #f8fafc;
        text-align: left;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .06em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .audit-table td {
        padding: 14px;
        border-top: 1px solid #f1f5f9;
        color: #334155;
        font-size: 11px;
        vertical-align: middle;
    }

    .audit-table tbody tr:hover {
        background: #fafcff;
    }

.audit-date-cell strong,
.audit-date-cell span {
    display: block;
}

.audit-date-cell strong {
    color: #0f172a;
    font-size: 11px;
}

.audit-date-cell span {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 9px;
}

.audit-user {
    font-weight: 800;
}

.audit-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10px !important;
}

.audit-badge,
.audit-http-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}

    .audit-badge.success,
    .audit-http-status.success {
        color: #166534;
        background: #dcfce7;
    }

    .audit-badge.danger,
    .audit-http-status.danger {
        color: #991b1b;
        background: #fee2e2;
    }

    .audit-badge.warning,
    .audit-http-status.warning {
        color: #92400e;
        background: #fef3c7;
    }

    .audit-badge.info {
        color: #1e40af;
        background: #dbeafe;
    }

    .audit-http-status.neutral {
        color: #475569;
        background: #f1f5f9;
    }

@media (max-width: 1200px) {
    .audit-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .audit-filters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .audit-header,
    .audit-filter-header {
        flex-direction: column;
    }

    .audit-refresh-button,
    .audit-clear-button {
        width: 100%;
    }

    .audit-stats-grid {
        grid-template-columns: 1fr;
    }
}
