/* V1.8.1 stabilization surfaces: production-safe System Console and security actions. */

.v181-console-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.v181-console-card {
    min-height: 142px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    justify-content: flex-start;
    padding: 18px;
    border: 1px solid #dce4e6;
    border-radius: 12px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 5px 18px rgba(11, 10, 11, .045);
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.v181-console-card:hover {
    transform: translateY(-1px);
    border-color: #9fcac3;
    box-shadow: 0 9px 24px rgba(11, 10, 11, .07);
}

.v181-console-card > span {
    color: #237f74;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.v181-console-card > strong {
    color: #102b35;
    font-size: 17px;
}

.v181-console-card > small {
    color: #66747c;
    font-size: 12px;
    line-height: 1.55;
}

.v181-console-card.is-primary {
    border-color: #b8d9d3;
    background: linear-gradient(180deg, #fff, #f5fbf9);
}

.v181-console-note {
    margin-top: 8px;
}

.v181-record-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.v181-record-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.v181-record-table th,
.v181-record-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e6ecee;
    text-align: left;
    vertical-align: top;
}

.v181-record-table th {
    color: #526169;
    background: #f7f9fa;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.v181-record-table td {
    color: #26343b;
    font-size: 12px;
    line-height: 1.45;
}

.v181-record-table code {
    display: block;
    max-width: 480px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #526169;
    font-size: 10px;
}

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

@media (max-width: 720px) {
    .v181-console-grid {
        grid-template-columns: 1fr;
    }
}



/* Lifecycle restore review and relationship detail */
.v181-lifecycle-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 16px;
    padding: 18px 20px;
    border: 1px solid #dce5e8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(11, 10, 11, .04);
}

.v181-lifecycle-panel.is-archive {
    border-color: #efd2ca;
    background: #fffaf8;
}

.v181-lifecycle-panel h2,
.v181-archived-explainer h2,
.v181-restore-tree-head h2 {
    margin: 3px 0 5px;
    color: #173f4d;
    font-size: 17px;
}

.v181-lifecycle-panel p,
.v181-archived-explainer p,
.v181-restore-tree-head p {
    margin: 0;
    color: #657984;
    line-height: 1.5;
}

.v181-relationship-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.v181-relationship-summary > div {
    min-height: 76px;
    padding: 13px 14px;
    border: 1px solid #e0e8ec;
    border-radius: 10px;
    background: #fbfcfc;
}

.v181-relationship-summary span,
.v181-relationship-summary strong {
    display: block;
}

.v181-relationship-summary span {
    margin-bottom: 5px;
    color: #71818a;
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.v181-relationship-summary strong {
    color: #173f4d;
    font-size: 15px;
}

.v181-archived-explainer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-top: 18px;
    padding: 17px 18px;
    border: 1px solid #b9ddd7;
    border-radius: 11px;
    background: #f4fbf9;
}

.v181-restore-card {
    max-width: 1120px;
}

.v181-restore-form {
    margin-top: 14px;
}

.v181-restore-form .v18-choice-row.is-disabled {
    opacity: .58;
    cursor: not-allowed;
}

.v181-restore-tree {
    margin-top: 18px;
    border: 1px solid #dce6e9;
    border-radius: 12px;
    overflow: hidden;
}

.v181-restore-tree-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 18px;
    background: #f8fafb;
    border-bottom: 1px solid #e1e9ec;
}

.v181-restore-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    color: #647680;
    font-size: 10px;
}

.v181-restore-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.v181-restore-legend i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.v181-restore-legend .is-cascade { background: #2b9c8d; }
.v181-restore-legend .is-previous { background: #9a7d4d; }
.v181-restore-legend .is-draft { background: #667985; }
.v181-restore-legend .is-legacy { background: #87939a; }

.v181-restore-relationship + .v181-restore-relationship {
    border-top: 1px solid #e6edef;
}

.v181-restore-relationship {
    padding: 15px 18px;
    background: #fff;
}

.v181-restore-relationship-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.v181-restore-relationship-head strong,
.v181-restore-relationship-head small,
.v181-restore-check strong,
.v181-restore-check small {
    display: block;
}

.v181-restore-relationship-head small,
.v181-restore-check small {
    margin-top: 2px;
    color: #71818a;
    font-size: 10px;
}

.v181-restore-check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    cursor: pointer;
}

.v181-origin-pill {
    flex: 0 0 auto;
    padding: 4px 7px;
    border: 1px solid #dbe2e5;
    border-radius: 999px;
    background: #f5f7f8;
    color: #66757d;
    font-size: 9px;
    font-weight: 800;
}

.v181-origin-pill.is-cascade {
    border-color: #b8ddd7;
    background: #eff9f7;
    color: #147368;
}

.v181-origin-pill.is-preexisting {
    border-color: #ead7b8;
    background: #fff8eb;
    color: #7a5a24;
}

.v181-origin-pill.is-draft {
    background: rgba(102, 121, 133, 0.12);
    color: #52636d;
    border-color: rgba(102, 121, 133, 0.28);
}

.v181-origin-pill.is-legacy {
    border-color: #d7dfe3;
    background: #f5f7f8;
    color: #66757d;
}

.v181-restore-blocked {
    margin-top: 9px;
    padding: 7px 9px;
    border-radius: 7px;
    background: #fff4ef;
    color: #8a3f2f;
    font-size: 10px;
}

.v181-restore-months {
    display: grid;
    gap: 7px;
    margin-top: 12px;
    padding-left: 26px;
}

.v181-restore-month {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid #e3eaed;
    border-radius: 8px;
    background: #fbfcfc;
    cursor: pointer;
}

.v181-restore-month:has(input:checked) {
    border-color: #9fd2ca;
    background: #f3fbf9;
}

.v181-restore-month.is-disabled {
    opacity: .62;
    cursor: not-allowed;
}

.v181-restore-month-copy strong,
.v181-restore-month-copy small,
.v181-restore-month-copy em {
    display: block;
}

.v181-restore-month-copy strong {
    color: #173f4d;
    font-size: 12px;
}

.v181-restore-month-copy small {
    margin-top: 2px;
    color: #71818a;
    font-size: 9px;
}

.v181-restore-month-copy em {
    margin-top: 3px;
    color: #8a3f2f;
    font-size: 9px;
    font-style: normal;
}

.v181-restore-empty {
    margin-top: 10px;
    padding-left: 26px;
    color: #798890;
    font-size: 10px;
}

.v181-safety-note {
    display: grid;
    gap: 3px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #cfe3e9;
    border-radius: 9px;
    background: #f6fbfc;
}

.v181-safety-note strong {
    color: #173f4d;
}

.v181-safety-note span {
    color: #627683;
    line-height: 1.48;
    font-size: 11px;
}

.v181-email-config {
    margin-top: 14px;
}

.v181-email-table {
    min-width: 1100px;
}

@media (max-width: 900px) {
    .v181-lifecycle-panel,
    .v181-archived-explainer,
    .v181-restore-tree-head {
        align-items: stretch;
        flex-direction: column;
    }

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

    .v181-restore-legend {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .v181-relationship-summary {
        grid-template-columns: 1fr;
    }

    .v181-restore-months {
        padding-left: 0;
    }

    .v181-restore-month {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .v181-restore-month .v181-origin-pill {
        grid-column: 2;
        width: max-content;
    }
}
