/* ===== Nexus dark theme — CSS variables (NEXUS-PLAN.md §7) ===== */
:root {
    --nexus-navy: #1e293b;
    --nexus-navy-dark: #0f1726;
    --nexus-blue: #3b82f6;
    --nexus-emerald: #10b981;
    --nexus-gray: #94a3b8;
    --nexus-soft-gray: #f8fafc;
    --nexus-white: #ffffff;
    --nexus-card-bg: #243447;
    --nexus-border: rgba(255,255,255,0.08);
    --nexus-danger: #ef4444;
}

html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--nexus-navy-dark);
    color: var(--nexus-soft-gray);
    margin: 0;
    padding: 0;
}

a, .btn-link {
    color: var(--nexus-blue);
}

h1, h2, h3, h4 {
    color: var(--nexus-white);
}

/* */

.nexus-dev-banner {
    background: #c0392b;
    color: white;
    text-align: center;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 14px;
    height: 22px;
    box-sizing: border-box;
    font-weight: bold;
    letter-spacing: .5px;
}

/* ===== Pagine a tutto schermo (viewer / designer) ===== */
.nexus-alert-error {
    margin: 0.75rem 1rem;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #ff8a7a;
    font-size: 0.85rem;
}

.nexus-alert-info {
    margin: 0.75rem 1rem;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #bfdbfe;
    font-size: 0.85rem;
}

/* Le pagine amministrative scorrono dentro il main, con il padding che il main non ha più. */
.nexus-page-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1.5rem 2rem 2rem;
}

.nexus-shell {
    display: flex;
    min-height: calc(100vh - 56px);
}

.nexus-main {
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

#blazor-error-ui {
    background: #2a1a1a;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #ff8a7a;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        float: right;
        font-weight: 700;
    }

.nexus-shell-with-nav {
    display: flex;
    align-items: stretch;
}

.nexus-shell-with-nav .nexus-main {
    min-width: 0;
    flex: 1;
}

/* ===== Generic page wrapper ===== */
.nexus-page-header {
    margin-bottom: 1.75rem;
}

.nexus-page-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.nexus-page-header p {
    color: var(--nexus-gray);
    margin: 0;
}

.nexus-empty-state {
    background: var(--nexus-card-bg);
    border: 1px solid var(--nexus-border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: var(--nexus-gray);
}

/* ===== Cards / panels ===== */
.nexus-card {
    background: var(--nexus-card-bg);
    border: 1px solid var(--nexus-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nexus-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

/* ===== Metric cards (Dashboard) ===== */
.nexus-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.nexus-metric-card {
    background: var(--nexus-card-bg);
    border: 1px solid var(--nexus-border);
    border-left: 3px solid var(--nexus-blue);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.nexus-metric-card.emerald { border-left-color: var(--nexus-emerald); }
.nexus-metric-card.danger { border-left-color: var(--nexus-danger); }

.nexus-metric-label {
    font-size: 0.8rem;
    color: var(--nexus-gray);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.nexus-metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--nexus-white);
}

.nexus-metric-delta {
    font-size: 0.82rem;
    margin-top: 0.3rem;
}

.nexus-metric-delta.up { color: var(--nexus-emerald); }
.nexus-metric-delta.down { color: var(--nexus-danger); }

/* ===== Forms ===== */
.nexus-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.nexus-form-group label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #8aaac8;
}

.nexus-form-input, .nexus-form-select {
    background: var(--nexus-navy);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: var(--nexus-soft-gray);
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
    outline: none;
}

.nexus-form-input:focus, .nexus-form-select:focus {
    border-color: var(--nexus-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

.nexus-form-hint {
    font-size: 0.76rem;
    line-height: 1.4;
    color: #6f8ba6;
}

.nexus-form-hint code {
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
    font-size: 0.74rem;
}

.nexus-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

/* ===== Buttons ===== */
.nexus-btn-primary {
    padding: 0.55rem 1.25rem;
    background: linear-gradient(135deg, var(--nexus-blue), #2563eb);
    border: none;
    border-radius: 8px;
    color: var(--nexus-white);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.nexus-btn-primary:hover { opacity: 0.88; }
.nexus-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.nexus-btn-secondary {
    padding: 0.55rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    color: var(--nexus-soft-gray);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.nexus-btn-secondary:hover { background: rgba(255,255,255,0.06); }

.nexus-btn-danger {
    padding: 0.45rem 0.9rem;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.35);
    border-radius: 8px;
    color: #ff8a7a;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

/* ===== Tables (DataTables / SchemaExplorer) ===== */
.nexus-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--nexus-border);
    border-radius: 12px;
}

.nexus-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.nexus-table th, .nexus-table td {
    text-align: left;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--nexus-border);
    white-space: nowrap;
}

.nexus-table th {
    background: rgba(255,255,255,0.03);
    color: var(--nexus-gray);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: .04em;
}

.nexus-table tbody tr:hover { background: rgba(59,130,246,0.06); }

.nexus-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.nexus-badge.pk { background: rgba(59,130,246,0.18); color: #93c5fd; }
.nexus-badge.fk { background: rgba(16,185,129,0.18); color: #6ee7b7; }
.nexus-badge.unique { background: rgba(148,163,184,0.18); color: #cbd5e1; }
.nexus-badge.online { background: rgba(16,185,129,0.18); color: #6ee7b7; }
.nexus-badge.offline { background: rgba(239,68,68,0.18); color: #fca5a5; }

/* ===== Status messages ===== */
.nexus-status-success { color: var(--nexus-emerald); font-size: 0.85rem; }
.nexus-status-error { color: #ff8a7a; font-size: 0.85rem; }

/* ===== Connections grid (Settings) ===== */
.nexus-connections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* ===== Schema explorer ===== */
.nexus-schema-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
}

.nexus-schema-tables-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
}

.nexus-schema-tables-list li button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--nexus-soft-gray);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.nexus-schema-tables-list li button:hover,
.nexus-schema-tables-list li button.active {
    background: rgba(59,130,246,0.14);
    color: var(--nexus-white);
}

/* ===== Blazor reconnect / error (mirrors WebStart) ===== */
.blazor-error-boundary {
    background-color: var(--nexus-danger);
    padding: 1rem 1rem 1rem 1.25rem;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.content { padding-top: 1.1rem; }
h1:focus { outline: none; }
.validation-message { color: var(--nexus-danger); }

/* ===== M2 — Analytics Chat ===== */
.nexus-chat-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 190px);
    min-height: 500px;
    border: 1px solid var(--nexus-border);
    border-radius: 10px;
    overflow: hidden;
}
.nexus-chat-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--nexus-navy);
    border-right: 1px solid var(--nexus-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.nexus-chat-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--nexus-border);
    font-weight: 600;
    font-size: .85rem;
    color: var(--nexus-gray);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.nexus-session-list { list-style: none; margin: 0; padding: .25rem 0; overflow-y: auto; flex: 1; }
.nexus-session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 1rem;
    cursor: pointer;
    border-radius: 6px;
    margin: 2px .4rem;
    font-size: .85rem;
    transition: background .15s;
}
.nexus-session-item:hover { background: rgba(59,130,246,.12); }
.nexus-session-item.active { background: rgba(59,130,246,.22); color: var(--nexus-white); }
.nexus-session-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nexus-session-date { font-size: .75rem; color: var(--nexus-gray); margin-left: .5rem; }
.nexus-chat-sidebar-footer {
    padding: .75rem 1rem;
    border-top: 1px solid var(--nexus-border);
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.nexus-form-label { font-size: .75rem; color: var(--nexus-gray); }
.nexus-select-sm { font-size: .8rem; padding: .25rem .4rem; }
.nexus-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--nexus-navy-dark);
}
.nexus-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.nexus-chat-welcome {
    text-align: center;
    margin: auto;
    max-width: 480px;
}
.nexus-chat-welcome-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.nexus-chat-suggestions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1rem; }
.nexus-suggestion-chip {
    background: rgba(59,130,246,.12);
    border: 1px solid var(--nexus-blue);
    color: var(--nexus-blue);
    border-radius: 20px;
    padding: .35rem .85rem;
    font-size: .8rem;
    cursor: pointer;
    transition: background .15s;
}
.nexus-suggestion-chip:hover { background: rgba(59,130,246,.25); }
.nexus-chat-bubble {
    max-width: 780px;
    padding: .75rem 1rem;
    border-radius: 10px;
    line-height: 1.55;
    font-size: .9rem;
}
.nexus-chat-user {
    align-self: flex-end;
    background: rgba(59,130,246,.18);
    border: 1px solid rgba(59,130,246,.3);
}
.nexus-chat-assistant {
    align-self: flex-start;
    background: var(--nexus-card-bg);
    border: 1px solid var(--nexus-border);
}
.nexus-typing-indicator { display: flex; gap: 4px; align-items: center; height: 20px; }
.nexus-typing-indicator span {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--nexus-blue);
    animation: typing-bounce 1.2s infinite;
}
.nexus-typing-indicator span:nth-child(2) { animation-delay: .2s; }
.nexus-typing-indicator span:nth-child(3) { animation-delay: .4s; }
@keyframes typing-bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
.nexus-sql-result-block { margin-top: .75rem; border-top: 1px solid var(--nexus-border); padding-top: .75rem; }
.nexus-sql-details summary { cursor: pointer; font-size: .8rem; color: var(--nexus-gray); margin-bottom: .4rem; }
.nexus-code-block {
    background: #0d1926;
    border: 1px solid var(--nexus-border);
    border-radius: 6px;
    padding: .75rem 1rem;
    font-size: .8rem;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    overflow-x: auto;
    white-space: pre;
    color: #7dd3fc;
    margin: .4rem 0;
}
.nexus-chat-input-bar {
    display: flex;
    gap: .5rem;
    padding: .75rem 1rem;
    border-top: 1px solid var(--nexus-border);
    background: var(--nexus-navy);
}
.nexus-chat-input {
    flex: 1;
    background: var(--nexus-navy-dark);
    border: 1px solid var(--nexus-border);
    border-radius: 8px;
    color: var(--nexus-soft-gray);
    padding: .5rem .75rem;
    font-size: .9rem;
    resize: none;
    font-family: inherit;
}
.nexus-chat-input:focus { outline: none; border-color: var(--nexus-blue); }
.nexus-chat-send {
    padding: .5rem .9rem;
    font-size: 1.1rem;
    align-self: flex-end;
}
/* ===== M3 — Dashboard ===== */
.nexus-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.nexus-metric-card {
    background: var(--nexus-card-bg);
    border: 1px solid var(--nexus-border);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow .2s;
}
.nexus-metric-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.nexus-metric-icon { font-size: 2rem; flex-shrink: 0; }
.nexus-metric-body { display: flex; flex-direction: column; gap: .15rem; }
.nexus-metric-label { font-size: .8rem; color: var(--nexus-gray); text-transform: uppercase; letter-spacing: .04em; }
.nexus-metric-value { font-size: 1.6rem; font-weight: 700; color: var(--nexus-white); }
.nexus-metric-subtitle { font-size: .75rem; color: var(--nexus-gray); }
.nexus-metric-revenue .nexus-metric-value { color: var(--nexus-emerald); }
.nexus-metric-expense .nexus-metric-value { color: #ef4444; }
.nexus-metric-growth .nexus-metric-value { color: var(--nexus-blue); }
.nexus-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.nexus-chart-card {
    background: var(--nexus-card-bg);
    border: 1px solid var(--nexus-border);
    border-radius: 10px;
    padding: 1.25rem;
}
.nexus-chart-title { font-size: .9rem; color: var(--nexus-gray); margin: 0 0 .75rem; text-transform: uppercase; letter-spacing: .04em; }
.nexus-chart-container { position: relative; }
.nexus-chart-placeholder { height: 220px; border-radius: 6px; background: rgba(255,255,255,.04); }
.nexus-chart-scalar { display: flex; align-items: center; justify-content: center; height: 100px; }
.nexus-chart-error { display: flex; align-items: center; justify-content: center; height: 100px; color: #ef4444; font-size: .85rem; }
.nexus-dashboard-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.nexus-status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.nexus-status-item { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.nexus-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nexus-status-dot.ok { background: var(--nexus-emerald); box-shadow: 0 0 6px var(--nexus-emerald); }
.nexus-status-dot.error { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.nexus-status-name { flex: 1; }
.nexus-status-type { color: var(--nexus-gray); font-size: .75rem; }
.nexus-status-latency { font-size: .75rem; color: var(--nexus-gray); margin-left: auto; }
.nexus-recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.nexus-recent-item { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--nexus-border); }
.nexus-recent-item:last-child { border-bottom: none; }
.nexus-recent-icon { font-size: 1.25rem; }
.nexus-recent-info { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.nexus-recent-name { font-size: .875rem; }
.nexus-recent-meta { font-size: .75rem; color: var(--nexus-gray); }
/* ===== M4 — Report Designer ===== */
.nexus-hint { font-size: .8rem; color: var(--nexus-gray); background: rgba(59,130,246,.07); border-left: 3px solid var(--nexus-blue); padding: .5rem .75rem; border-radius: 0 6px 6px 0; margin: .5rem 0; }
.nexus-textarea-code { font-family: 'Cascadia Code', 'Consolas', monospace; font-size: .82rem; }
.nexus-visual-row input { font-size: .82rem; }
/* ===== M5 — Sync tasks / Gateway ===== */
.nexus-badge { display: inline-block; padding: .2rem .55rem; border-radius: 12px; font-size: .72rem; font-weight: 600; background: rgba(255,255,255,.08); }
.nexus-badge-success { background: rgba(16,185,129,.2); color: #34d399; }
.nexus-badge-error   { background: rgba(239,68,68,.2);  color: #f87171; }
.nexus-badge-warn    { background: rgba(251,191,36,.2);  color: #fbbf24; }
.nexus-hint-inline { cursor: help; }
.nexus-gateway-steps { display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0; }
.nexus-step { display: flex; gap: 1rem; align-items: flex-start; }
.nexus-step-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--nexus-blue); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.nexus-gateway-note {
    margin-top: 1rem;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--nexus-border);
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .85rem;
}
/* ===== Result grid ===== */
.nexus-result-grid-wrap { overflow: hidden; }
.nexus-table-scroll { overflow-x: auto; max-height: 320px; overflow-y: auto; }
.nexus-result-count { font-size: .75rem; color: var(--nexus-gray); margin: .4rem 0 0; }
.nexus-badge-warn { background: rgba(251,191,36,.15); color: #fbbf24; font-size: .75rem; display: inline-block; padding: .2rem .5rem; border-radius: 4px; margin-bottom: .5rem; }
.nexus-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.nexus-link-sm { font-size: .8rem; color: var(--nexus-blue); }
.nexus-btn-sm { background: transparent; border: 1px solid var(--nexus-border); color: var(--nexus-gray); border-radius: 6px; padding: .2rem .5rem; cursor: pointer; font-size: .8rem; }
.nexus-error-text { color: #ef4444; }
/* ===== Loading pulse ===== */
.nexus-loading-pulse { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ===== NexusProject editor + Integrated analytics ===== */
.nexus-empty-small { font-size: .8rem; color: var(--nexus-gray); margin: .35rem 0; }
.nexus-binding-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.nexus-binding-col {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--nexus-border);
    border-radius: 8px;
    padding: .75rem .9rem;
}
.nexus-binding-col h4 { margin: 0 0 .5rem; font-size: .85rem; color: var(--nexus-white); display: flex; align-items: center; gap: .4rem; }
.nexus-count { background: rgba(59,130,246,.2); color: var(--nexus-blue); border-radius: 10px; padding: 0 .45rem; font-size: .72rem; }
.nexus-check-row { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; font-size: .85rem; cursor: pointer; }
.nexus-order-badge { background: rgba(16,185,129,.2); color: var(--nexus-emerald); border-radius: 8px; padding: 0 .4rem; font-size: .7rem; margin-left: .3rem; }
.nexus-config-chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

.nexus-isteps {
    margin-bottom: .6rem;
    border: 1px solid var(--nexus-border);
    border-radius: 8px;
    background: rgba(255,255,255,.02);
    padding: .5rem .7rem;
}
.nexus-isteps > summary { cursor: pointer; font-size: .8rem; color: var(--nexus-gray); }
.nexus-istep {
    border-left: 3px solid var(--nexus-border);
    padding: .4rem 0 .4rem .7rem;
    margin: .5rem 0 0;
}
.nexus-istep-sql { border-left-color: var(--nexus-blue); }
.nexus-istep-kb { border-left-color: var(--nexus-emerald); }
.nexus-istep-info { border-left-color: var(--nexus-gray); }
.nexus-istep-error { border-left-color: var(--nexus-danger); }
.nexus-istep-head { font-size: .82rem; display: flex; align-items: baseline; gap: .35rem; flex-wrap: wrap; }
.nexus-istep-kind { flex-shrink: 0; }
.nexus-istep-detail { color: var(--nexus-gray); }
.nexus-kb-excerpt {
    font-size: .8rem;
    color: var(--nexus-soft-gray, #cbd5e1);
    background: #0d1926;
    border: 1px solid var(--nexus-border);
    border-radius: 6px;
    padding: .5rem .7rem;
    margin: .4rem 0;
    white-space: pre-wrap;
}


/* ===== Amministrazione (progetti / team / sorgenti) ===== */
.nexus-admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--nexus-border);
}
.nexus-admin-tab {
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--nexus-gray);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0.6rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nexus-admin-tab:hover { color: var(--nexus-white); }
.nexus-admin-tab.is-active { color: var(--nexus-white); border-bottom-color: var(--nexus-blue); }
.nexus-admin-tab-step {
    width: 1.4rem; height: 1.4rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08); font-size: 0.72rem;
}
.nexus-admin-tab.is-active .nexus-admin-tab-step { background: var(--nexus-blue); color: #fff; }

.nexus-admin-form { margin-bottom: 1.25rem; background: rgba(255,255,255,0.03); }
.nexus-admin-columns { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.4fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .nexus-admin-columns { grid-template-columns: 1fr; } }
.nexus-admin-inline { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.nexus-admin-inline .nexus-form-input, .nexus-admin-inline .nexus-form-select { flex: 1 1 14rem; width: auto; }
.nexus-admin-new-team { flex: 1 1 12rem !important; }
.nexus-admin-role-select { flex: 0 1 18rem !important; }
.nexus-admin-add-member { margin-bottom: 1rem; }
.nexus-admin-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }
.nexus-admin-row-actions { display: flex; gap: 0.4rem; flex-wrap: nowrap; align-items: center; }
.nexus-admin-row-actions .nexus-btn-secondary, .nexus-admin-row-actions .nexus-btn-danger { padding: 0.35rem 0.7rem; font-size: 0.78rem; white-space: nowrap; }
.nexus-admin-row-actions a.nexus-btn-secondary { text-decoration: none; }
.nexus-admin-checklist {
    display: grid; gap: 0.3rem;
    max-height: 18rem; overflow-y: auto;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--nexus-border); border-radius: 8px;
    background: rgba(255,255,255,0.02);
}
.nexus-admin-checklist .nexus-check-row { align-items: flex-start; }
.nexus-admin-checklist input { margin-top: 0.25rem; }
.nexus-admin-muted { color: var(--nexus-gray); font-size: 0.8rem; }
.nexus-admin-path { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; font-family: 'Cascadia Code', Consolas, monospace; font-size: 0.78rem; }
.nexus-admin-empty { text-align: center; color: var(--nexus-gray); padding: 1.5rem !important; }
.nexus-admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.nexus-admin-list-item {
    display: flex; align-items: center; gap: 0.5rem;
    border: 1px solid var(--nexus-border); border-radius: 8px; padding: 0.3rem 0.5rem 0.3rem 0;
}
.nexus-admin-list-item.is-active { border-color: rgba(59,130,246,0.5); background: rgba(59,130,246,0.1); }
.nexus-admin-list-button {
    flex: 1; min-width: 0; text-align: left;
    background: transparent; border: 0; color: var(--nexus-soft-gray);
    padding: 0.5rem 0.75rem; cursor: pointer; font: inherit;
    display: flex; flex-direction: column; gap: 0.15rem;
}
.nexus-table td.nexus-admin-row-actions { white-space: normal; }
