/* Dark futuristic — refined glass, grid, cyan/violet glow */
:root {
    --embed-cyan: #00d4ff;
    --embed-cyan-dim: #7dd3fc;
    --embed-cyan-soft: rgba(0, 212, 255, 0.12);
    --embed-cyan-border: rgba(0, 212, 255, 0.22);
    --embed-cyan-hover: rgba(0, 212, 255, 0.5);
    --embed-violet: #a78bfa;
    --embed-violet-soft: rgba(124, 58, 237, 0.22);
    --embed-text: #f8fafc;
    --embed-muted: #94a3b8;
    --embed-subtle: #64748b;
    --embed-glass: rgba(15, 23, 42, 0.72);
    --embed-glass-border: rgba(0, 212, 255, 0.14);
}

.embed-shell {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 90% 55% at 50% -15%, rgba(0, 212, 255, 0.18), transparent 60%),
        radial-gradient(ellipse 55% 45% at 100% 80%, rgba(124, 58, 237, 0.14), transparent 55%),
        radial-gradient(ellipse 40% 35% at 0% 60%, rgba(0, 212, 255, 0.06), transparent 50%),
        linear-gradient(168deg, #070b12 0%, #0b0f1a 38%, #0f172a 100%);
    color: #e8f4ff;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

.embed-shell-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 40%, black 20%, transparent 75%);
}

.embed-hub {
    position: relative;
    z-index: 1;
    padding: 1.35rem 1.5rem 2.5rem;
    max-width: 1440px;
    margin: 0 auto;
}

/* ── Header ── */
.embed-hub-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
    padding: 1.15rem 1.35rem;
    border-radius: 18px;
    border: 1px solid var(--embed-glass-border);
    background: linear-gradient(135deg, rgba(20, 27, 45, 0.88) 0%, rgba(11, 15, 26, 0.92) 100%);
    backdrop-filter: blur(16px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.embed-hub-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.embed-hub-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #00d4ff 0%, #6366f1 55%, #7c3aed 100%);
    color: #0b0f1a;
    box-shadow:
        0 0 28px rgba(0, 212, 255, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.embed-hub-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(92deg, #00d4ff 0%, #67e8f9 35%, #c4b5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1.25;
}

.embed-hub-sub {
    font-size: 0.8rem;
    color: var(--embed-muted);
    margin: 0.3rem 0 0;
    letter-spacing: 0.02em;
}

.embed-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid rgba(0, 212, 255, 0.3);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(124, 58, 237, 0.08));
    color: var(--embed-cyan-dim);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.08);
}

.embed-status-pill--live::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e, 0 0 20px rgba(34, 197, 94, 0.4);
    animation: embed-pulse 2s ease-in-out infinite;
}

@keyframes embed-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.92); }
}

/* ── Search ── */
.embed-search {
    margin-bottom: 1.35rem;
}

.embed-search .mud-input-outlined-border {
    border-color: rgba(0, 212, 255, 0.2) !important;
    border-radius: 14px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.embed-search .mud-input-root:hover .mud-input-outlined-border {
    border-color: rgba(0, 212, 255, 0.35) !important;
}

.embed-search .mud-input-root.mud-input-root-outlined:focus-within .mud-input-outlined-border {
    border-color: rgba(0, 212, 255, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 0 24px rgba(0, 212, 255, 0.12) !important;
}

.embed-search .mud-input-root {
    background: rgba(11, 15, 26, 0.75) !important;
    border-radius: 14px;
    backdrop-filter: blur(8px);
}

.embed-search .mud-input-slot {
    color: var(--embed-text) !important;
    font-size: 0.9rem !important;
}

.embed-search .mud-input-adornment .mud-icon-root {
    color: var(--embed-cyan) !important;
    opacity: 0.85;
}

.embed-search .mud-input::placeholder,
.embed-search input::placeholder {
    color: var(--embed-subtle) !important;
    opacity: 0.9;
}

/* ── Asset grid ── */
.embed-asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 1rem;
}

.embed-asset-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding: 0;
    border-radius: 16px;
    border: 1px solid var(--embed-glass-border);
    background: linear-gradient(165deg, rgba(22, 30, 50, 0.9) 0%, rgba(11, 15, 26, 0.95) 100%);
    backdrop-filter: blur(14px);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.embed-asset-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.5), rgba(167, 139, 250, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.embed-asset-card::after {
    content: "View details →";
    position: absolute;
    bottom: 0.85rem;
    right: 1rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--embed-cyan);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.embed-asset-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 212, 255, 0.38);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(0, 212, 255, 0.1),
        0 0 32px rgba(0, 212, 255, 0.08);
}

.embed-asset-card:hover::before {
    opacity: 1;
}

.embed-asset-card:hover::after {
    opacity: 0.85;
    transform: translateX(0);
}

.embed-asset-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.05rem 1.1rem 0.65rem;
}

.embed-asset-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.15), rgba(124, 58, 237, 0.12));
    color: var(--embed-cyan);
    border: 1px solid rgba(0, 212, 255, 0.28);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.08);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.embed-asset-card:hover .embed-asset-card-icon {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    transform: scale(1.04);
}

.embed-asset-card-body {
    flex: 1;
    min-width: 0;
}

.embed-asset-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--embed-text);
    margin-bottom: 0.15rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.embed-asset-meta-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0 1.1rem 1rem;
}

.embed-asset-meta-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.74rem;
    color: var(--embed-muted);
    line-height: 1.35;
    padding: 0.28rem 0.55rem;
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.04);
    border: 1px solid rgba(0, 212, 255, 0.06);
}

.embed-asset-meta-row .meta-ico {
    font-size: 0.85rem !important;
    color: var(--embed-cyan) !important;
    opacity: 0.9;
    flex-shrink: 0;
}

.embed-asset-meta-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.embed-asset-card-footer {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.1rem 0.95rem;
    border-top: 1px solid rgba(0, 212, 255, 0.06);
    margin-top: auto;
}

.embed-asset-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--embed-violet-soft);
    color: #c4b5fd;
    border: 1px solid rgba(124, 58, 237, 0.35);
}

.embed-asset-tag--ok {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
}

.embed-asset-tag--warn {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.35);
}

.embed-asset-tag--maint {
    background: rgba(167, 139, 250, 0.14);
    color: #ddd6fe;
    border-color: rgba(167, 139, 250, 0.4);
}

.embed-asset-tag--neutral {
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.25);
}

/* ── Detail panel ── */
.embed-detail-panel {
    border-radius: 18px;
    border: 1px solid var(--embed-glass-border);
    background: linear-gradient(165deg, rgba(20, 27, 45, 0.94) 0%, rgba(7, 11, 18, 0.98) 100%);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
}

.embed-detail-head {
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.07) 0%, transparent 65%);
}

.embed-detail-title-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.4rem;
}

.embed-detail-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #00d4ff 0%, #7c3aed 100%);
    color: #0b0f1a;
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.35);
}

.embed-back-btn {
    text-transform: none !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    border-radius: 10px !important;
}

.embed-hub-ops-link {
    margin-bottom: 0.65rem;
    padding-left: 0.25rem !important;
}

/* ── Metrics ── */
.embed-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.9rem;
    padding: 1.1rem 1.4rem 1.4rem;
}

.embed-metric {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.95rem 1.05rem;
    border-radius: 14px;
    border: 1px solid rgba(0, 212, 255, 0.12);
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.05), rgba(124, 58, 237, 0.03));
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.embed-metric:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 212, 255, 0.22);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.08);
}

.embed-metric-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.embed-metric-icon--blue,
.embed-metric-icon--indigo {
    background: rgba(0, 212, 255, 0.14);
    color: var(--embed-cyan);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.1);
}

.embed-metric-icon--violet {
    background: rgba(124, 58, 237, 0.22);
    color: var(--embed-violet);
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.12);
}

.embed-metric-icon--amber {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

.embed-metric-icon--green {
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
}

.embed-metric-body {
    min-width: 0;
}

.embed-metric-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--embed-subtle);
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.embed-metric-value {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--embed-cyan);
    line-height: 1.2;
}

/* ── WO table ── */
.embed-table-wrap {
    padding: 0 1.4rem 1.4rem;
    overflow-x: auto;
}

.embed-wo-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.1);
}

.embed-wo-table th {
    text-align: left;
    padding: 0.75rem 0.9rem;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 800;
    color: var(--embed-cyan-dim);
    background: rgba(0, 212, 255, 0.06);
    border-bottom: 1px solid rgba(0, 212, 255, 0.12);
}

.embed-wo-table td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
    color: #cbd5e1;
    background: rgba(11, 15, 26, 0.4);
}

.embed-wo-table tbody tr:last-child td {
    border-bottom: none;
}

.embed-wo-table tbody tr {
    transition: background 0.15s ease;
}

.embed-wo-table tbody tr:hover td {
    background: rgba(0, 212, 255, 0.06);
}

.embed-wo-row {
    cursor: pointer;
}

.embed-wo-row:active td {
    background: rgba(0, 212, 255, 0.1) !important;
}

.embed-wo-id--link {
    text-decoration: underline;
    text-decoration-color: rgba(0, 212, 255, 0.35);
    text-underline-offset: 2px;
}

.embed-wo-row:hover .embed-wo-id--link {
    text-decoration-color: rgba(0, 212, 255, 0.75);
}

.embed-wo-id {
    color: var(--embed-cyan);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ── States ── */
.embed-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 340px;
    gap: 1.15rem;
    color: var(--embed-muted);
}

.embed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--embed-subtle);
    font-size: 0.9rem;
    border-radius: 18px;
    border: 1px dashed rgba(0, 212, 255, 0.15);
    background: rgba(0, 212, 255, 0.02);
}

.embed-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(0, 212, 255, 0.12), rgba(124, 58, 237, 0.1));
    color: var(--embed-cyan);
    border: 1px solid rgba(0, 212, 255, 0.25);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.1);
}

.embed-empty-hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: var(--embed-muted);
    max-width: 28rem;
    line-height: 1.45;
}

.embed-empty-hint a {
    color: var(--embed-accent, #00d4ff);
    text-decoration: none;
}

.embed-empty-hint a:hover {
    text-decoration: underline;
}

/* ── Tabs ── */
.embed-tabs .mud-tab {
    text-transform: none !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    min-height: 48px !important;
}

.embed-tabs .mud-tab.mud-tab-active {
    color: var(--embed-cyan) !important;
}

.embed-tabs .mud-tabs-toolbar {
    background: rgba(7, 11, 18, 0.6) !important;
    border-bottom: 1px solid rgba(0, 212, 255, 0.08) !important;
}

.embed-tabs .mud-tabs-slider {
    background: linear-gradient(90deg, #00d4ff, #a78bfa) !important;
    height: 3px !important;
    border-radius: 3px 3px 0 0;
}

/* Scrollbar (WebKit) */
.embed-table-wrap::-webkit-scrollbar,
.embed-shell::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.embed-table-wrap::-webkit-scrollbar-thumb,
.embed-shell::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.25);
    border-radius: 999px;
}
