﻿/* ========================================
   DASHBOARD EDITOR - CSS COMPLETO CORRETTO
   ======================================== */

/* === PAGE LAYOUT === */
.dashboard-editor-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: #0a0a14;
    overflow: hidden;
}

.editor-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 20, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* === TOOLBAR === */
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border-bottom: 1px solid #334155;
    height: 56px;
    flex-shrink: 0;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-title h5 {
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #fff;
}

.editor-toolbar .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
}

    .editor-toolbar .btn-outline-light:hover,
    .editor-toolbar .btn-outline-light.active {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.5);
    }

/* === TAGS PANEL === */
.tags-panel {
    width: 320px;
    min-width: 320px;
    background: #1e293b;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
}

    .tags-panel.hidden {
        width: 0;
        min-width: 0;
        border-right: none;
    }

.tags-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
    color: #fff;
}

.tags-panel-search {
    padding: 12px 16px;
    border-bottom: 1px solid #334155;
}

.tags-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.tags-panel-footer {
    padding: 12px 16px;
    background: #0f172a;
    border-top: 1px solid #334155;
    text-align: center;
}

/* === TAG GROUPS === */
.tag-group {
    margin-bottom: 4px;
}

.tag-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #0f172a;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

    .tag-group-header:hover {
        background: #1e3a5f;
        color: #fff;
    }

.tag-group-items {
    padding: 4px 8px;
}

/* === TAG ITEMS === */
.tag-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    cursor: grab;
    transition: all 0.2s ease;
}

    .tag-item:hover {
        border-color: #3b82f6;
        background: #1e3a5f;
        transform: translateX(4px);
    }

    .tag-item:active {
        cursor: grabbing;
    }

.tag-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.tag-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tag-id {
    color: #60a5fa;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-name {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drag-handle {
    color: #475569;
    font-size: 0.9rem;
}

/* ========================================
   CANVAS - STRUTTURA CRITICA
   ======================================== */

/* Contenitore principale del canvas */
.canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    background: #0a0a14;
}

/* Canvas Wrapper - centra il canvas con aspect-ratio dinamico */
.canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0a0a14;
    height: 100%;
}

/* Frame canvas - aspect-ratio settato inline da JS per matchare il viewer */
.canvas-scroll-area {
    position: relative;
    width: 100%;
    max-height: 100%;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    /* aspect-ratio viene settato inline da Blazor/JS */
}

/* Canvas vero - POSITION ABSOLUTE + INSET 0 è CRITICO */
.dashboard-canvas {
    position: absolute;
    inset: 0;
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
    container-type: inline-size;
    --rpx: min(0.0521cqi, 0.0926vh);        /* 1px @1920x1080; su ultrawide vh limita */
}

    /* Griglia editor */
    .dashboard-canvas.show-grid {
        background-image: linear-gradient(rgba(59, 130, 246, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(59, 130, 246, 0.08) 1px, transparent 1px);
        background-size: 1% 2%;
    }

/* === BACKGROUND === */
.canvas-background-img,
.canvas-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* === CANVAS ELEMENTS === */
.canvas-element {
    position: absolute;
    cursor: move;
    transition: box-shadow 0.2s ease;
    /*z-index: 10;*/
}

    .canvas-element.editable {
        cursor: move;
    }

    .canvas-element:hover {
        /*z-index: 20;*/
    }

    .canvas-element.selected {
        /*z-index: 30;*/
        box-shadow: 0 0 0 2px #3b82f6, 0 0 20px rgba(59, 130, 246, 0.3);
    }

    .canvas-element.dragging {
        opacity: 0.7;
        /*z-index: 100;*/
        cursor: grabbing;
    }

/* === ELEMENT CONTENT === */
.element-content {
    /* Rimosso min-width/height - gestito per tipo */
}

.is-circle-element .element-content,
.canvas-element.is-circle-element .element-content {
    min-width: 0 !important;
    min-height: 0 !important;
}

.canvas-element:not(.is-circle-element):not(.is-container) .element-content {
    min-width: 0;
    min-height: 0;
}

.canvas-element.is-container .element-content {
    min-width: 0;
    min-height: 0;
}

/* === ELEMENT HOVER MENU === */
.element-hover-menu {
    position: absolute;
    top: -40px;
    right: 0;
    display: flex;
    gap: 4px;
    background: #1e293b;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 50;
}

.canvas-element:hover .element-hover-menu {
    opacity: 1;
}

.element-hover-menu button {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

    .element-hover-menu button:hover {
        background: #334155;
        color: #fff;
    }

    .element-hover-menu button.delete:hover {
        background: #ef4444;
        color: #fff;
    }

/* === ELEMENT TOOLBAR === */
.element-toolbar {
    z-index: 50 !important;
}

/* === RESIZE HANDLES === */
.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #3b82f6;
    border: 2px solid #fff;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s;
    /*z-index: 60;*/
}

.canvas-element.selected .resize-handle {
    opacity: 1;
}

.resize-handle.nw {
    top: -5px;
    left: -5px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -5px;
    right: -5px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -5px;
    left: -5px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

/* === ELEMENT TYPE LABEL === */
.element-type-label {
    position: absolute;
    bottom: -18px;
    left: 0;
    font-size: 0.6rem;
    color: #64748b;
    white-space: nowrap;
}

.element-type-badge {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 600;
    margin-right: 4px;
}

.type-component .element-type-badge {
    background: #3b82f6;
    color: #fff;
}

.type-gauge .element-type-badge {
    background: #22c55e;
    color: #fff;
}

.type-vtag .element-type-badge {
    background: #f59e0b;
    color: #fff;
}

/* === DROP INDICATOR === */
.drop-indicator {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 80px;
    background: rgba(59, 130, 246, 0.2);
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1000;
    animation: pulse 1s ease-in-out infinite;
}

    .drop-indicator i {
        font-size: 1.5rem;
        margin-bottom: 4px;
    }

.drag-ghost {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 40px;
    background: rgba(59, 130, 246, 0.3);
    border: 2px solid #3b82f6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    pointer-events: none;
    z-index: 999;
}

/* === EMPTY STATE === */
.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #475569;
    pointer-events: none;
}

    .empty-state h5 {
        color: #64748b;
    }

/* === SCADA COMPONENT STYLES === */
.scada-component {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 6px;
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.component-header {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.component-body {
    padding: 6px;
    display: flex;
    gap: 4px;
}

    .component-body.flex-column {
        flex-direction: column;
    }

    .component-body.flex-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .component-body.flex-wrap {
        flex-wrap: wrap;
    }

.feature-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 0;
    gap: 8px;
}

.feature-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.feature-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

.feature-bit {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

    .feature-bit.on {
        background: #22c55e;
        box-shadow: 0 0 8px #22c55e;
    }

    .feature-bit.off {
        background: #ef4444;
        box-shadow: 0 0 8px #ef4444;
    }

/* === GAUGE PREVIEW === */
.gauge-preview {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    min-width: 120px;
}

.gauge-header {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.gauge-arc {
    position: relative;
    width: 100px;
    margin: 0 auto;
}

.gauge-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Roboto Mono', monospace;
}

.gauge-unit {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 4px;
}

/* === VTAG PREVIEW === */
.vtag-preview {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 6px;
    padding: 8px 12px;
    text-align: center;
    min-width: 80px;
}

.vtag-header {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 6px;
}

.vtag-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin: 0 auto;
    transition: all 0.3s;
}

    .vtag-circle.active {
        box-shadow: 0 0 12px currentColor;
    }

.vtag-value {
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: #fff;
}

/* === MISSING DATA === */
.missing-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px dashed #ef4444;
    border-radius: 6px;
    color: #ef4444;
    min-width: 100px;
    min-height: 60px;
}

    .missing-data i {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }

    .missing-data span {
        font-size: 0.75rem;
    }

/* === SCROLLBARS === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #475569;
    }

/* ========================================
   LIGHT MODE OVERRIDES
   Sovrascrivono i colori dark quando
   data-bs-theme="light" è attivo
   ======================================== */

[data-bs-theme="light"] .tags-panel {
    background: var(--bs-secondary-bg);
    border-right-color: var(--bs-border-color);
}

[data-bs-theme="light"] .tags-panel-header {
    background: var(--bs-tertiary-bg);
    border-bottom-color: var(--bs-border-color);
    color: var(--bs-emphasis-color);
}

[data-bs-theme="light"] .tags-panel-search {
    border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="light"] .tags-panel-footer {
    background: var(--bs-tertiary-bg);
    border-top-color: var(--bs-border-color);
}

[data-bs-theme="light"] .tag-group-header {
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
}

[data-bs-theme="light"] .tag-group-header:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--bs-emphasis-color);
}

[data-bs-theme="light"] .tag-item {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="light"] .tag-item:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: #3b82f6;
}

[data-bs-theme="light"] .drag-handle {
    color: var(--bs-secondary-color);
}

[data-bs-theme="light"] ::-webkit-scrollbar-track {
    background: var(--bs-secondary-bg);
}

[data-bs-theme="light"] ::-webkit-scrollbar-thumb {
    background: var(--bs-border-color);
}

[data-bs-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary-color);
}

/* === LIGHT MODE - Main Structure === */
[data-bs-theme="light"] .dashboard-editor-page {
    background: var(--bs-body-bg);
}

[data-bs-theme="light"] .editor-main {
    background: var(--bs-body-bg);
}

[data-bs-theme="light"] .canvas-container {
    background: var(--bs-tertiary-bg);
}

[data-bs-theme="light"] .canvas-wrapper {
    background: var(--bs-tertiary-bg);
}

[data-bs-theme="light"] .canvas-scroll-area {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="light"] .loading-overlay {
    background: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="light"] .loading-overlay .text-light {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="light"] .editor-toolbar {
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
    border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="light"] .toolbar-title h5 {
    color: var(--bs-emphasis-color);
}

[data-bs-theme="light"] .editor-toolbar .btn-outline-light {
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

[data-bs-theme="light"] .editor-toolbar .btn-outline-light:hover,
[data-bs-theme="light"] .editor-toolbar .btn-outline-light.active {
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--bs-border-color);
}

[data-bs-theme="light"] .element-hover-menu {
    background: var(--bs-body-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="light"] .element-hover-menu button {
    color: var(--bs-body-color);
}

[data-bs-theme="light"] .element-hover-menu button:hover {
    background: var(--bs-secondary-bg);
    color: var(--bs-emphasis-color);
}

[data-bs-theme="light"] .empty-state {
    color: var(--bs-secondary-color);
}

[data-bs-theme="light"] .empty-state h5 {
    color: var(--bs-secondary-color);
}

/* === TOASTS === */
.toast-container {
    z-index: 9999;
}

.toast {
    min-width: 300px;
}

/* === UTILITIES === */
.bg-purple {
    background-color: #8b5cf6 !important;
}

.text-purple {
    color: #8b5cf6 !important;
}

/* === ANIMATIONS === */
@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.8;
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .tags-panel {
        position: absolute;
        left: 0;
        top: 56px;
        bottom: 0;
        z-index: 100;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

        .tags-panel.hidden {
            transform: translateX(-100%);
        }

    .canvas-container {
        padding: 10px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOT DASHBOARD WIDGET (ldw-*)
   Compact panel for lot management — used as dashboard element
   ═══════════════════════════════════════════════════════════════════════════ */
.ldw {
    width: 100%;
    height: 100%;
    color: #e2e8f0;
    font-size: .78rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Style: Glass (default) ─────────────────────────────── */
.ldw--glass {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ── Style: Solid ───────────────────────────────────────── */
.ldw--solid {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 4px;
}
.ldw--solid .ldw-header { border-bottom-color: #334155; }
.ldw--solid .ldw-active { border-left-width: 4px; }
.ldw--solid .ldw-new-form { border-bottom-color: #334155; }

/* ── Style: Minimal ─────────────────────────────────────── */
.ldw--minimal {
    background: transparent;
    border: none;
    border-radius: 0;
}
.ldw--minimal .ldw-header {
    border-bottom: none;
    padding-bottom: 4px;
}
.ldw--minimal .ldw-active {
    border-left: none;
    background: transparent;
    padding-left: 0;
}
.ldw--minimal .ldw-new-form { border-bottom: none; }
.ldw--minimal .ldw-queue-item { border-bottom-color: rgba(255,255,255,.06); }

/* Loading */
.ldw-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--bs-primary);
}

/* Header */
.ldw-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ldw-header-icon { font-size: .8rem; opacity: .6; }
.ldw-title {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    opacity: .7;
    flex: 1;
}
.ldw-count {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: .62rem;
    font-weight: 600;
}

/* Buttons (generic) */
.ldw-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all .12s;
    color: #e2e8f0;
    background: transparent;
    padding: 0;
}
.ldw-btn--add {
    width: 22px; height: 22px;
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    font-size: .65rem;
}
.ldw-btn--add:hover { background: rgba(34, 197, 94, 0.35); }

/* Quick add form */
.ldw-new-form {
    display: flex;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    align-items: flex-end;
}
.ldw-new-fields {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}
.ldw-new-extra {
    font-size: .65rem !important;
    opacity: .8;
}
.ldw-new-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    color: #e2e8f0;
    padding: 3px 8px;
    font-size: .72rem;
    outline: none;
    min-width: 0;
}
.ldw-new-input::placeholder { color: rgba(226, 232, 240, 0.35); }
.ldw-new-input:focus { border-color: rgba(99, 102, 241, 0.5); }
.ldw-btn--go {
    width: 26px; height: 26px;
    background: rgba(34, 197, 94, 0.25);
    color: #22c55e;
    font-size: .68rem;
    flex-shrink: 0;
}
.ldw-btn--go:hover { background: rgba(34, 197, 94, 0.4); }
.ldw-btn--go:disabled { opacity: .3; cursor: not-allowed; }

/* Active lot */
.ldw-active {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid #22c55e;
    background: rgba(34, 197, 94, 0.06);
}
.ldw-active.paused {
    border-left-color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
}
.ldw-active-top {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ldw-active-name {
    font-weight: 700;
    font-size: .82rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ldw-active-extra {
    font-size: .65rem;
    opacity: .5;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pulse dot */
.ldw-pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    animation: ldw-pulse-anim 1.5s ease-in-out infinite;
}
.ldw-pulse.paused {
    background: #6366f1;
    animation: none;
}
@keyframes ldw-pulse-anim {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50% { opacity: .7; box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

/* Status badge */
.ldw-status-badge {
    font-size: .58rem;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.badge-running { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.badge-paused  { background: rgba(99, 102, 241, 0.2); color: #818cf8; }

/* Controls */
.ldw-controls {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.ldw-ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: .68rem;
    transition: all .12s;
}
.ldw-ctrl:disabled { opacity: .3; cursor: not-allowed; }
.ldw-ctrl--play {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}
.ldw-ctrl--play:hover:not(:disabled) { background: rgba(34, 197, 94, 0.35); }
.ldw-ctrl--pause {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}
.ldw-ctrl--pause:hover:not(:disabled) { background: rgba(99, 102, 241, 0.35); }
.ldw-ctrl--stop {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}
.ldw-ctrl--stop:hover:not(:disabled) { background: rgba(239, 68, 68, 0.3); }

/* Empty state */
.ldw-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 10px;
    opacity: .35;
    font-size: .72rem;
}
.ldw-empty i { font-size: 1.2rem; }

/* Queue */
.ldw-queue {
    max-height: 140px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.ldw-queue-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ldw-queue-item:last-child { border-bottom: none; }
.ldw-queue-name {
    flex: 1;
    font-size: .72rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ldw-queue-status {
    font-size: .58rem;
    opacity: .5;
    text-transform: uppercase;
    letter-spacing: .04em;
    flex-shrink: 0;
}
.ldw-btn--start-queue {
    width: 20px; height: 18px;
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    font-size: .58rem;
    flex-shrink: 0;
}
.ldw-btn--start-queue:hover:not(:disabled) { background: rgba(34, 197, 94, 0.4); }
.ldw-queue-more {
    text-align: center;
    font-size: .62rem;
    opacity: .35;
    padding: 3px 0;
}

/* Error */
.ldw-error {
    padding: 4px 10px 6px;
    font-size: .65rem;
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
}
