/* CS16 Panel v6 — Nodes Core */

.v6-page-head,
.v6-detail-head,
.v6-card-head,
.v6-modal-head,
.v6-head-actions,
.v6-detail-title,
.v6-chart-title,
.v6-resource-row > div:first-child,
.v6-mini-usage > div:first-child,
.v6-copy-row,
.v6-modal-actions {
    display: flex;
    align-items: center;
}

.v6-page-head,
.v6-detail-head,
.v6-card-head,
.v6-modal-head,
.v6-chart-title,
.v6-resource-row > div:first-child,
.v6-mini-usage > div:first-child {
    justify-content: space-between;
}

.v6-page-head,
.v6-detail-head {
    gap: 20px;
    margin-bottom: 18px;
}

.v6-page-head h2,
.v6-detail-head h2,
.v6-card h3,
.v6-modal-card h2,
.v6-chart-card h3 {
    margin: 0;
}

.v6-page-head p,
.v6-detail-head p,
.v6-card-head p,
.v6-modal-head p {
    margin: 5px 0 0;
    color: #78879a;
    font-size: 12px;
}

.v6-head-actions,
.v6-modal-actions {
    flex-wrap: wrap;
    gap: 8px;
}

.v6-button,
.v6-icon-button {
    border: 1px solid #2b394c;
    background: #131d29;
    color: #d7e0eb;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .35px;
    cursor: pointer;
    transition: .15s ease;
}

.v6-button {
    min-height: 36px;
    padding: 9px 13px;
}

.v6-button.small {
    min-height: 31px;
    padding: 7px 10px;
    font-size: 10px;
}

.v6-button:hover,
.v6-icon-button:hover {
    border-color: #4a5f79;
    background: #1a2737;
    color: #fff;
}

.v6-button.primary {
    border-color: #b32631;
    background: #941b25;
    color: #fff;
}

.v6-button.primary:hover {
    background: #b0202d;
}

.v6-button.warning {
    border-color: rgba(245, 158, 11, .45);
    color: #fbbf24;
}

.v6-button.danger {
    border-color: rgba(239, 68, 68, .55);
    color: #f87171;
}

.v6-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.v6-icon-button {
    width: 36px;
    height: 36px;
    font-size: 20px;
}

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

.v6-summary,
.v6-card,
.v6-node-row,
.v6-metric,
.v6-chart-card,
.v6-allocation {
    border: 1px solid #202d3e;
    background: #0d141e;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .14);
}

.v6-summary {
    padding: 16px;
    border-radius: 10px;
}

.v6-summary span,
.v6-metric span {
    display: block;
    color: #728196;
    font-size: 11px;
}

.v6-summary strong {
    display: block;
    margin-top: 7px;
    font-size: 25px;
    color: #f2f5f9;
}

.v6-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(170px, 240px);
    gap: 10px;
    margin-bottom: 12px;
}

.v6-input,
.v6-select,
.v6-field input,
.v6-field textarea,
.v6-code,
.v6-copy-row input {
    width: 100%;
    border: 1px solid #273649;
    background: #080e15;
    color: #eef3f8;
    border-radius: 7px;
    outline: none;
}

.v6-input,
.v6-select,
.v6-field input,
.v6-copy-row input {
    min-height: 39px;
    padding: 10px 12px;
}

.v6-field textarea,
.v6-code {
    padding: 12px;
    resize: vertical;
}

.v6-input:focus,
.v6-select:focus,
.v6-field input:focus,
.v6-field textarea:focus,
.v6-code:focus {
    border-color: #9f2530;
    box-shadow: 0 0 0 3px rgba(159, 37, 48, .12);
}

.v6-node-list {
    display: grid;
    gap: 9px;
}

.v6-node-row {
    display: grid;
    grid-template-columns: minmax(230px, 1.35fr) 135px minmax(180px, .9fr) minmax(220px, 1.25fr) 120px 110px 90px;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 9px;
    cursor: pointer;
    transition: .14s ease;
}

.v6-node-row:hover {
    border-color: #475a72;
    background: #111b28;
    transform: translateY(-1px);
}

.v6-node-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.v6-node-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(145deg, #9b1e29, #4e1218);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.v6-node-identity strong,
.v6-node-agent strong,
.v6-node-counts strong {
    display: block;
    color: #eaf0f7;
    font-size: 13px;
}

.v6-node-identity span,
.v6-node-agent span,
.v6-node-counts span,
.v6-node-identity small,
.v6-node-agent small,
.v6-node-counts small,
.v6-node-state small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v6-node-identity span,
.v6-node-agent span,
.v6-node-counts span {
    margin-top: 4px;
    color: #8291a4;
    font-size: 11px;
}

.v6-node-identity small,
.v6-node-agent small,
.v6-node-counts small,
.v6-node-state small {
    margin-top: 4px;
    color: #58677a;
    font-size: 10px;
}

.v6-node-state {
    min-width: 0;
}

.v6-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid #2b3748;
    border-radius: 6px;
    background: #151d28;
    color: #9aa8b9;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .5px;
}

.v6-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.v6-status.online {
    color: #4ade80;
    border-color: rgba(74, 222, 128, .32);
    background: rgba(34, 197, 94, .08);
}

.v6-status.offline {
    color: #94a3b8;
}

.v6-status.maintenance {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, .35);
    background: rgba(245, 158, 11, .08);
}

.v6-status.error {
    color: #f87171;
    border-color: rgba(248, 113, 113, .35);
}

.v6-node-resources {
    display: grid;
    gap: 6px;
}

.v6-mini-usage > div:first-child,
.v6-resource-row > div:first-child {
    gap: 12px;
    color: #7d8da2;
    font-size: 10px;
}

.v6-mini-usage b,
.v6-resource-row strong {
    color: #dce4ee;
    font-weight: 700;
}

.v6-progress {
    height: 4px;
    margin-top: 4px;
    overflow: hidden;
    border-radius: 10px;
    background: #202a38;
}

.v6-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #75151e, #d4313e);
}

.v6-progress.large {
    height: 7px;
    margin-top: 8px;
}

.v6-detail-title {
    gap: 12px;
    align-items: flex-start;
}

.v6-detail-title h2 {
    margin-top: 7px;
    font-size: 23px;
}

.v6-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 5px;
    margin-bottom: 14px;
    border: 1px solid #202c3c;
    border-radius: 8px;
    background: #0b1119;
}

.v6-tab {
    flex: 0 0 auto;
    border: 0;
    border-radius: 6px;
    padding: 10px 13px;
    background: transparent;
    color: #748398;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.v6-tab:hover {
    color: #fff;
    background: #141f2c;
}

.v6-tab.active {
    color: #fff;
    background: #7d1821;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

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

.v6-metric {
    padding: 15px;
    border-radius: 9px;
}

.v6-metric strong {
    display: block;
    margin-top: 7px;
    color: #edf2f8;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.v6-card {
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.v6-card-head {
    gap: 12px;
    margin-bottom: 16px;
}

.v6-card-head h3,
.v6-chart-card h3 {
    font-size: 14px;
    color: #eef3f8;
}

.v6-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.v6-resource-row {
    margin-bottom: 18px;
}

.v6-resource-row:last-child {
    margin-bottom: 0;
}

.v6-info-list {
    display: grid;
    gap: 2px;
}

.v6-info {
    display: grid;
    grid-template-columns: minmax(130px, .65fr) minmax(0, 1.35fr);
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #1a2533;
}

.v6-info:last-child {
    border-bottom: 0;
}

.v6-info span {
    color: #748398;
    font-size: 11px;
}

.v6-info strong {
    color: #dfe6ef;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.mono,
.v6-code,
.v6-copy-row input {
    font-family: Consolas, "Courier New", monospace;
}

.v6-table {
    overflow-x: auto;
}

.v6-table-head,
.v6-table-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) 130px minmax(120px, .7fr) 100px minmax(170px, .9fr);
    gap: 14px;
    align-items: center;
    min-width: 780px;
    padding: 11px 9px;
}

.v6-table-head {
    color: #627187;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    border-bottom: 1px solid #233043;
}

.v6-table-row {
    color: #cbd5e1;
    font-size: 11px;
    border-bottom: 1px solid #182332;
}

.v6-table-row strong,
.v6-table-row small {
    display: block;
}

.v6-table-row small {
    margin-top: 4px;
    color: #64748b;
}

.v6-allocation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.v6-allocation {
    padding: 14px;
    border-radius: 8px;
}

.v6-allocation strong,
.v6-allocation span,
.v6-allocation small {
    display: block;
}

.v6-allocation strong {
    color: #edf2f7;
    font-family: Consolas, monospace;
    font-size: 13px;
}

.v6-allocation span {
    margin-top: 7px;
    font-size: 11px;
    color: #9ba9ba;
}

.v6-allocation small {
    margin-top: 4px;
    color: #627086;
}

.v6-allocation.free {
    border-color: rgba(74, 222, 128, .25);
}

.v6-allocation.free span {
    color: #4ade80;
}

.v6-allocation.assigned {
    border-color: rgba(251, 191, 36, .25);
}

.v6-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.v6-chart-card {
    padding: 14px;
    border-radius: 9px;
    overflow: hidden;
}

.v6-chart-title {
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.v6-chart-title strong {
    margin-left: auto;
    color: #f0f4f8;
    font-size: 15px;
}

.v6-chart-title span {
    color: #69798d;
    font-size: 10px;
}

.v6-chart-card svg {
    display: block;
    width: 100%;
    height: 155px;
}

.v6-chart-card line {
    stroke: #263445;
    stroke-width: 2;
}

.v6-chart-card polyline {
    fill: none;
    stroke: #d3313f;
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 5px rgba(211, 49, 63, .35));
}

.v6-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.v6-field {
    display: block;
    margin-bottom: 12px;
}

.v6-field > span {
    display: block;
    margin-bottom: 7px;
    color: #8998aa;
    font-size: 11px;
    font-weight: 700;
}

.v6-copy-row {
    gap: 8px;
}

.v6-code {
    min-height: 165px;
    line-height: 1.5;
    color: #bfe8ce;
}

.v6-activation-box,
.v6-activation-card {
    border: 1px solid color-mix(in srgb, var(--cs16-accent, #d3313f) 32%, #263448);
    border-radius: 9px;
    background: color-mix(in srgb, var(--cs16-accent, #d3313f) 4%, #0c141f);
}

.v6-activation-box {
    padding: 15px;
    margin-top: 16px;
}

.v6-step-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    padding: 0;
    margin: 0 0 14px;
    list-style: none;
}

.v6-step-list li {
    min-width: 0;
    padding: 11px;
    border: 1px solid #243246;
    border-radius: 8px;
    background: rgba(7, 13, 21, .52);
}

.v6-step-list b,
.v6-step-list span {
    display: block;
}

.v6-step-list b {
    color: #e8eef7;
    font-size: 11px;
}

.v6-step-list span {
    margin-top: 5px;
    color: #7f90a5;
    font-size: 10px;
    line-height: 1.45;
}

.v6-setup-code {
    width: 100%;
    margin-bottom: 11px;
}

.v6-activity-list {
    display: grid;
}

.v6-activity-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px solid #1a2634;
}

.v6-activity-row > i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b52531;
    box-shadow: 0 0 9px rgba(181, 37, 49, .7);
}

.v6-activity-row strong,
.v6-activity-row span {
    display: block;
}

.v6-activity-row strong {
    color: #dae2ec;
    font-size: 12px;
}

.v6-activity-row span,
.v6-activity-row time {
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
}

.v6-alert,
.v6-warning,
.v6-success {
    margin-bottom: 12px;
    padding: 11px 13px;
    border-radius: 7px;
    font-size: 11px;
    line-height: 1.45;
}

.v6-alert.success,
.v6-success {
    border: 1px solid rgba(74, 222, 128, .28);
    background: rgba(34, 197, 94, .08);
    color: #86efac;
}

.v6-alert.error {
    border: 1px solid rgba(248, 113, 113, .32);
    background: rgba(239, 68, 68, .08);
    color: #fca5a5;
}

.v6-warning {
    border: 1px solid rgba(251, 191, 36, .28);
    background: rgba(245, 158, 11, .07);
    color: #fcd34d;
}

.v6-danger-zone {
    border-color: rgba(239, 68, 68, .35);
}

.v6-empty {
    padding: 36px 18px;
    text-align: center;
    color: #68778a;
    font-size: 12px;
}

.v6-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 5, 9, .82);
    backdrop-filter: blur(5px);
}

.v6-modal-card {
    width: min(680px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    padding: 22px;
    border: 1px solid #314055;
    border-radius: 11px;
    background: #0d151f;
    box-shadow: 0 35px 100px rgba(0, 0, 0, .6);
}

.v6-modal-card.wide {
    width: min(820px, 100%);
}

.v6-modal-head {
    gap: 15px;
    margin-bottom: 18px;
}

.v6-modal-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

@media (max-width: 1300px) {
    .v6-node-row {
        grid-template-columns: minmax(230px, 1.25fr) 125px minmax(170px, .9fr) minmax(210px, 1.1fr) 105px 88px;
    }
    .v6-node-row > .v6-button {
        display: none;
    }
}

@media (max-width: 1080px) {
    .v6-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .v6-node-row {
        grid-template-columns: minmax(220px, 1.3fr) 130px minmax(180px, 1fr) minmax(220px, 1.2fr);
    }
    .v6-node-counts {
        display: none;
    }
    .v6-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .v6-step-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .v6-page-head,
    .v6-detail-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .v6-summary-grid,
    .v6-two-column,
    .v6-chart-grid,
    .v6-form-grid,
    .v6-allocation-grid {
        grid-template-columns: 1fr;
    }
    .v6-toolbar {
        grid-template-columns: 1fr;
    }
    .v6-node-row {
        grid-template-columns: 1fr 1fr;
    }
    .v6-node-identity,
    .v6-node-resources {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .v6-step-list {
        grid-template-columns: 1fr;
    }
    .v6-copy-row {
        flex-wrap: wrap;
    }
    .v6-copy-row input {
        flex: 1 0 100%;
    }
    .v6-summary-grid,
    .v6-metric-grid,
    .v6-node-row {
        grid-template-columns: 1fr;
    }
    .v6-node-state,
    .v6-node-agent {
        padding-top: 8px;
        border-top: 1px solid #1c2836;
    }
    .v6-info {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    .v6-overlay {
        padding: 10px;
    }
    .v6-modal-card {
        padding: 16px;
    }
}

/* v6 Agent services and journal */
.v6-service-list {
    display: grid;
    gap: 8px;
}

.v6-service-row {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) 105px minmax(150px, .8fr);
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid #1e2c3d;
    border-radius: 7px;
    background: #09111a;
}

.v6-service-row > div strong,
.v6-service-row > div span {
    display: block;
}

.v6-service-row > div strong {
    color: #edf3fa;
    font-size: 12px;
}

.v6-service-row > div span,
.v6-service-row small {
    margin-top: 3px;
    color: #708197;
    font-size: 10px;
}

.v6-service-state {
    justify-self: start;
    padding: 5px 8px;
    border: 1px solid #344154;
    border-radius: 5px;
    color: #aeb9c8;
    background: #151d28;
    font-size: 10px;
    font-weight: 800;
}

.v6-service-state.active {
    border-color: rgba(34, 197, 94, .38);
    color: #57df87;
    background: rgba(34, 197, 94, .1);
}

.v6-service-state.failed,
.v6-service-state.inactive {
    border-color: rgba(239, 68, 68, .4);
    color: #ff7777;
    background: rgba(239, 68, 68, .1);
}

.v6-log-output {
    width: 100%;
    min-height: 330px;
    max-height: 520px;
    overflow: auto;
    margin: 0;
    padding: 14px;
    border: 1px solid #26364a;
    border-radius: 7px;
    background: #04080d;
    color: #d8e2ee;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    line-height: 1.48;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 720px) {
    .v6-service-row {
        grid-template-columns: 1fr auto;
    }
    .v6-service-row small {
        grid-column: 1 / -1;
    }
}
