body {
    background: #f6f7f9;
    color: #1f2933;
    min-height: 100vh;
}

.container-fluid {
    max-width: 1480px;
}

.content-narrow {
    max-width: 820px;
}

.brand-logo {
    height: 28px;
    width: auto;
}

.metric,
.form-panel,
.table-shell {
    background: #fff;
    border: 1px solid #d9dee5;
    border-radius: 8px;
}

.metric {
    padding: 18px;
}

.metric-link {
    color: inherit;
    display: block;
    height: 100%;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.metric-link:hover {
    border-color: #9fb2ca;
    box-shadow: 0 8px 22px rgba(31, 41, 51, 0.08);
    transform: translateY(-1px);
}

.metric span {
    color: #637083;
    display: block;
    font-size: 0.9rem;
}

.metric strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
    margin-top: 8px;
}

.metric-danger { border-left: 4px solid #dc3545; }
.metric-warning { border-left: 4px solid #ffc107; }
.metric-success { border-left: 4px solid #198754; }
.metric-muted { border-left: 4px solid #6c757d; }

.form-panel {
    padding: 22px;
}

.filter-panel {
    align-items: center;
    background: #fff;
    border: 1px solid #d9dee5;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px;
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
}

.search-form {
    display: flex;
    flex: 0 0 520px;
    gap: 8px;
    max-width: 100%;
}

.upload-zone {
    background: #f8fafc;
    border: 1px dashed #b7c3d0;
    border-radius: 8px;
    padding: 16px;
}

.table-shell {
    overflow: hidden;
}

.cert-mobile-list {
    display: none;
}

.cert-mobile-card,
.cert-mobile-empty {
    background: #fff;
    border: 1px solid #d9dee5;
    border-radius: 8px;
    padding: 12px;
}

.cert-mobile-card {
    color: inherit;
    display: grid;
    gap: 4px;
    line-height: 1.35;
    text-decoration: none;
}

.cert-mobile-card strong,
.cert-mobile-card span {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cert-mobile-card strong {
    font-weight: 700;
}

.cert-mobile-status {
    align-self: start;
    border: 1px solid #6c757d;
    border-radius: 6px;
    color: #4b5563;
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 6px;
    padding: 6px 9px;
    text-transform: uppercase;
    width: fit-content;
}

.cert-mobile-status-danger {
    border-color: #dc3545;
    color: #b02a37;
}

.cert-mobile-status-warning {
    border-color: #ffc107;
    color: #8a6400;
}

.cert-mobile-status-success {
    border-color: #198754;
    color: #146c43;
}

.cert-mobile-status-secondary,
.cert-mobile-status-muted {
    border-color: #6c757d;
    color: #4b5563;
}

.cert-mobile-card:hover {
    border-color: #9fb2ca;
    box-shadow: 0 6px 18px rgba(31, 41, 51, 0.08);
}

.cert-mobile-empty {
    color: #637083;
    text-align: center;
}

.issuer-cell {
    max-width: 240px;
}

.actions-cell {
    min-width: 310px;
}

.actions-muted .btn {
    opacity: 0.82;
}

.action-group {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 330px;
}

.action-group form {
    margin: 0;
}

.action-group .btn {
    min-width: 74px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.detail-grid div {
    background: #fff;
    border: 1px solid #d9dee5;
    border-radius: 8px;
    padding: 14px;
}

.embedded-grid div {
    background: #f8fafc;
}

.detail-grid span {
    color: #637083;
    display: block;
    font-size: 0.85rem;
}

.detail-grid strong {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.audit-list {
    display: grid;
    gap: 12px;
}

.audit-list div {
    border-bottom: 1px solid #e5e8ec;
    padding-bottom: 12px;
}

.audit-list span,
.audit-list small {
    color: #637083;
    display: block;
}

.diagnostic-list {
    display: grid;
    grid-template-columns: minmax(150px, 220px) 1fr;
    column-gap: 16px;
    row-gap: 8px;
}

.diagnostic-list dt {
    color: #637083;
    font-weight: 600;
}

.diagnostic-list dd {
    margin-bottom: 0;
}

.message-box {
    white-space: pre-wrap;
}

.app-footer {
    background: #fff;
    border-top: 1px solid #d9dee5;
    color: #46576b;
    margin-top: 24px;
    padding: 28px 16px;
}

.footer-inner {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-inner img {
    height: 34px;
    width: auto;
}

.login-body {
    align-items: center;
    background: linear-gradient(180deg, #f7fafc 0%, #edf4f8 100%);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.login-wrap {
    width: min(390px, calc(100% - 32px));
}

.login-card {
    background: #fff;
    border: 1px solid #d9dee5;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(31, 41, 51, 0.12);
    padding: 30px;
}

.login-logo {
    display: block;
    margin: 0 auto 24px;
    max-width: 250px;
    width: 80%;
}

@media (max-width: 640px) {
    .diagnostic-list {
        grid-template-columns: 1fr;
    }

    .filter-panel,
    .search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-panel {
        justify-content: flex-start;
    }

    .search-form {
        flex: 1 1 auto;
        width: 100%;
    }

    .quick-filters {
        flex: 0 1 auto;
    }

    .cert-desktop-table {
        display: none;
    }

    .cert-mobile-list {
        display: grid;
        gap: 10px;
    }
}
