/*
 * Astricode Ops — administration panel styles.
 * Loaded only on the plugin's own screens.
 */

.tbm-dashboard {
    max-width: 1400px;
}

.tbm-health-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 20px 0;
    padding: 24px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-left-width: 6px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.tbm-health-score {
    min-width: 130px;
    line-height: 1;
}

.tbm-health-score strong {
    font-size: 56px;
}

.tbm-health-score span {
    font-size: 20px;
    color: #646970;
}

.tbm-health-hero h2 {
    margin: 0 0 8px;
    font-size: 24px;
}

.tbm-health-hero p {
    margin: 4px 0;
}

.tbm-health-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.tbm-health-refresh {
    margin: 0;
}

.tbm-health-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.tbm-health-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-top-width: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.tbm-health-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 12px;
}

.tbm-health-card header h2 {
    margin: 0 0 4px;
}

.tbm-health-card header span {
    color: #646970;
}

.tbm-health-card header > strong {
    font-size: 24px;
}

.tbm-health-card table {
    border: 0;
    box-shadow: none;
}

.tbm-health-card td:last-child {
    text-align: right;
}

.tbm-health-progress {
    height: 8px;
    margin: 0 20px 18px;
    background: #f0f0f1;
    border-radius: 20px;
    overflow: hidden;
}

.tbm-health-progress span {
    display: block;
    width: 0;
    height: 100%;
    transition: width .25s ease;
}

.tbm-health-excellent {
    border-color: #00a32a;
}

.tbm-health-good {
    border-color: #72aee6;
}

.tbm-health-warning {
    border-color: #dba617;
}

.tbm-health-critical {
    border-color: #d63638;
}

.tbm-health-excellent .tbm-health-progress span {
    background: #00a32a;
}

.tbm-health-good .tbm-health-progress span {
    background: #2271b1;
}

.tbm-health-warning .tbm-health-progress span {
    background: #dba617;
}

.tbm-health-critical .tbm-health-progress span {
    background: #d63638;
}

.tbm-health-recommendations {
    margin-top: 24px;
    padding: 20px;
    background: #fff;
    border: 1px solid #dcdcde;
}

.tbm-health-recommendations h2 {
    margin-top: 0;
}

.tbm-health-recommendations .notice {
    margin: 10px 0 0;
}

.tbm-version {
    margin-top: 18px;
}

/* Clases reutilizables para migrar gradualmente el resto de vistas. */
.tbm-section {
    margin-top: 30px;
}

.tbm-divider {
    margin: 40px 0 30px;
}

.tbm-content-narrow {
    max-width: 900px;
}

.tbm-content-medium {
    max-width: 1100px;
}

.tbm-content-wide {
    max-width: 1400px;
}

.tbm-muted {
    color: #50575e;
}

.tbm-form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tbm-log-data {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

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

    .tbm-health-hero {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .tbm-health-actions {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .tbm-health-hero {
        gap: 16px;
        padding: 18px;
    }

    .tbm-health-score {
        min-width: auto;
    }

    .tbm-health-score strong {
        font-size: 44px;
    }

    .tbm-health-card header {
        padding: 16px;
    }

    .tbm-health-progress {
        margin-right: 16px;
        margin-left: 16px;
    }
}

/* Utilidades compartidas por todas las pantallas del plugin. */
.tbm-table { width: 100%; }
.tbm-content-1000 { max-width: 1000px; }
.tbm-content-1050 { max-width: 1050px; }
.tbm-content-1250 { max-width: 1250px; }
.tbm-mt-15 { margin-top: 15px; }
.tbm-mt-16 { margin-top: 16px; }
.tbm-mt-18 { margin-top: 18px; }
.tbm-mt-20 { margin-top: 20px; }
.tbm-mt-25 { margin-top: 25px; }
.tbm-mt-28 { margin-top: 28px; }
.tbm-mt-35 { margin-top: 35px; }
.tbm-mb-16 { margin-bottom: 16px; }
.tbm-ml-15 { margin-left: 15px; }
.tbm-my-15 { margin-top: 15px; margin-bottom: 15px; }
.tbm-my-20 { margin-top: 20px; margin-bottom: 20px; }
.tbm-divider-large { margin-top: 42px; }
.tbm-divider-compact { margin: 35px 0; }
.tbm-options-analysis-form { margin: 18px 0 24px; }
.tbm-subheading { margin: 20px 0 8px; }
.tbm-input-80 { width: 80px; }
.tbm-input-90 { width: 90px; }
.tbm-input-120 { width: 120px; }
.tbm-col-count { width: 130px; }
.tbm-col-action { width: 390px; }
.tbm-panel-form {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #dcdcde;
    background: #fff;
}
.tbm-audit-progress {
    max-width: 1000px;
    height: 22px;
    margin-top: 15px;
    overflow: hidden;
    background: #dcdcde;
    border-radius: 3px;
}
.tbm-audit-progress > div {
    width: 0;
    height: 100%;
    background: #2271b1;
    transition: width .25s ease;
}
.tbm-audit-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin-top: 30px;
}

@media (max-width: 782px) {
    .tbm-form-row { align-items: stretch; }
    .tbm-form-row select,
    .tbm-form-row .button { width: 100%; }
    .tbm-col-count,
    .tbm-col-action { width: auto; }
    .tbm-ml-15 { margin-left: 0; }
}

.tbm-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 20px;
    margin: 14px 0 20px;
}

.tbm-actions-row form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.tbm-input-100 {
    width: 100px;
}

@media (max-width: 782px) {
    .tbm-actions-row,
    .tbm-actions-row form {
        align-items: stretch;
        flex-direction: column;
    }
}


/* Technical diagnostics. */
.tbm-diagnostics {
    max-width: 1400px;
}

.tbm-diagnostics-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 20px 0;
    padding: 24px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-left: 6px solid #2271b1;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.tbm-diagnostics-hero.is-ready {
    border-left-color: #00a32a;
}

.tbm-diagnostics-hero.needs-attention {
    border-left-color: #d63638;
}

.tbm-diagnostics-score {
    min-width: 130px;
    line-height: 1;
}

.tbm-diagnostics-score strong {
    font-size: 52px;
}

.tbm-diagnostics-score span {
    color: #646970;
    font-size: 20px;
}

.tbm-diagnostics-heading h2 {
    margin: 0 0 8px;
    font-size: 23px;
}

.tbm-diagnostics-heading p {
    margin: 4px 0;
}

.tbm-diagnostics-refresh {
    margin-left: auto;
}

.tbm-diagnostics-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.tbm-diagnostics-summary > div {
    padding: 18px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-top-width: 4px;
    text-align: center;
}

.tbm-diagnostics-summary strong {
    display: block;
    margin-bottom: 5px;
    font-size: 28px;
}

.tbm-diagnostics-summary .is-success {
    border-top-color: #00a32a;
}

.tbm-diagnostics-summary .is-warning {
    border-top-color: #dba617;
}

.tbm-diagnostics-summary .is-critical {
    border-top-color: #d63638;
}

.tbm-diagnostics-summary .is-info {
    border-top-color: #2271b1;
}

.tbm-diagnostics-note {
    margin: 20px 0;
}

.tbm-diagnostics-section {
    margin-top: 28px;
}

.tbm-diagnostics-section > h2 {
    margin-bottom: 12px;
}

.tbm-diagnostics-list {
    display: grid;
    gap: 10px;
}

.tbm-diagnostic-item {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 18px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-left-width: 5px;
}

.tbm-diagnostic-item.is-success {
    border-left-color: #00a32a;
}

.tbm-diagnostic-item.is-warning {
    border-left-color: #dba617;
}

.tbm-diagnostic-item.is-critical {
    border-left-color: #d63638;
}

.tbm-diagnostic-item.is-info {
    border-left-color: #2271b1;
}

.tbm-diagnostic-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.tbm-diagnostic-status span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #2271b1;
}

.tbm-diagnostic-item.is-success .tbm-diagnostic-status span {
    background: #00a32a;
}

.tbm-diagnostic-item.is-warning .tbm-diagnostic-status span {
    background: #dba617;
}

.tbm-diagnostic-item.is-critical .tbm-diagnostic-status span {
    background: #d63638;
}

.tbm-diagnostic-content h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.tbm-diagnostic-content p {
    margin: 4px 0;
}

@media (max-width: 960px) {
    .tbm-diagnostics-hero {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .tbm-diagnostics-refresh {
        width: 100%;
        margin-left: 0;
    }

    .tbm-diagnostics-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .tbm-diagnostics-hero {
        gap: 16px;
        padding: 18px;
    }

    .tbm-diagnostics-score {
        min-width: auto;
    }

    .tbm-diagnostics-score strong {
        font-size: 44px;
    }

    .tbm-diagnostics-summary {
        grid-template-columns: 1fr;
    }

    .tbm-diagnostic-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}


/* General table catalog and quarantine. */
.tbm-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tbm-toolbar form {
    margin: 0;
}

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

.tbm-content-1500 {
    width: 100%;
    max-width: 1500px;
}

.tbm-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.tbm-summary-card {
    display: flex;
    min-height: 82px;
    flex-direction: column;
    justify-content: center;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #dcdcde;
}

.tbm-summary-card strong {
    font-size: 22px;
    line-height: 1.2;
}

.tbm-summary-card span {
    margin-top: 5px;
    color: #646970;
}

.tbm-inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tbm-inline-actions form {
    margin: 0;
}

@media (max-width: 960px) {
    .tbm-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .tbm-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Inspector operativo de wp_options. */
.tbm-option-search label {
    display: block;
    margin-bottom: 6px;
}

.tbm-status-pill {
    display: inline-block;
    max-width: 260px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.4;
}

.tbm-status-protected {
    color: #8a2424;
    background: #fbeaea;
    border: 1px solid #d63638;
}

.tbm-status-available {
    color: #0a5c24;
    background: #e7f7ec;
    border: 1px solid #00a32a;
}

.tbm-inspector-detail {
    padding: 20px;
    background: #fff;
    border: 1px solid #dcdcde;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.tbm-inspector-detail > h3 {
    margin-top: 0;
}

.tbm-option-preview {
    max-height: 460px;
    padding: 16px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
}

.tbm-hash {
    overflow-wrap: anywhere;
    word-break: break-all;
}

.tbm-danger-zone {
    padding: 18px;
    background: #fff8f8;
    border: 1px solid #d63638;
    border-left-width: 4px;
}

.tbm-danger-zone h4 {
    margin-top: 0;
    color: #8a2424;
}

@media (max-width: 782px) {
    .tbm-option-search .regular-text,
    .tbm-danger-zone .regular-text {
        width: 100%;
        max-width: none;
    }

    .tbm-inspector-detail {
        padding: 14px;
    }
}

/* Inspector operativo de wp_postmeta. */
.tbm-status-warning {
    color: #704d00;
    background: #fff8d8;
    border: 1px solid #dba617;
}

.tbm-preview-compact {
    min-width: 280px;
    max-width: 560px;
    max-height: 220px;
    margin: 0;
    padding: 10px;
    font-size: 12px;
}

.tbm-postmeta-inspector .tbm-subheading {
    margin-top: 26px;
}

/* Trazabilidad del firewall de registros. */
.tbm-registration-trace-panel {
    margin-top: 22px;
    padding: 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.tbm-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.tbm-section-heading h2 {
    margin: 0 0 4px;
}

.tbm-section-heading p {
    margin: 0;
}

.tbm-trace-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.tbm-trace-summary-card {
    padding: 18px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
}

.tbm-trace-summary-card h3 {
    margin: 0 0 10px;
}

.tbm-trace-primary {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
}

.tbm-trace-summary-card dl {
    margin: 0;
}

.tbm-trace-summary-card dl > div {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px;
    padding: 6px 0;
    border-top: 1px solid #dcdcde;
}

.tbm-trace-summary-card dt {
    font-weight: 600;
}

.tbm-trace-summary-card dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.tbm-trace-counters th:last-child,
.tbm-trace-counters td:last-child {
    width: 180px;
    text-align: right;
}

@media (max-width: 782px) {
    .tbm-section-heading {
        display: block;
    }

    .tbm-section-heading > strong {
        display: inline-block;
        margin-top: 10px;
    }

    .tbm-trace-summary-grid {
        grid-template-columns: 1fr;
    }

    .tbm-trace-summary-card dl > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}
