/* Label Editor Layout */
.le-layout {
    display: flex;
    gap: 8px;
    height: calc(100vh - 180px);
    min-height: 400px;
}

.le-panel {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.le-panel-left {
    width: 240px;
    min-width: 200px;
    overflow-y: auto;
}

.le-panel-center {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.le-panel-right {
    width: 220px;
    min-width: 180px;
    overflow-y: auto;
}

/* Sections */
.le-section {
    border-bottom: 1px solid #dee2e6;
}

.le-section:last-child {
    border-bottom: none;
    flex: 1;
}

.le-section-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    padding: 8px 10px 4px;
}

.le-section-header.le-collapsible {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.le-section-header.le-collapsible:hover {
    color: #495057;
}

.le-section-header.le-collapsible i {
    font-size: 0.6rem;
    transition: transform 0.15s;
}

.le-section-header.le-collapsible.collapsed i {
    transform: rotate(-90deg);
}

.le-section-body {
    overflow: hidden;
}

.le-section-header.collapsed + .le-section-body {
    display: none;
}

/* Tools */
.le-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px 10px 10px;
}

.le-tool {
    width: 34px;
    height: 34px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #495057;
    transition: background-color 0.1s, border-color 0.1s;
}

.le-tool:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.le-tool.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.le-tool:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.le-tool-separator {
    width: 100%;
    height: 0;
    margin: 2px 0;
}

/* Properties */
.le-properties {
    padding: 10px;
}

.le-hint {
    padding: 10px;
    text-align: center;
    font-style: italic;
}

/* Canvas area */
.le-canvas-wrapper {
    flex: 1;
    display: grid;
    grid-template-columns: 20px 1fr;
    grid-template-rows: 20px 1fr;
    overflow: hidden;
    background: #f0f0f0;
}

.le-ruler {
    background: #e9ecef;
    overflow: hidden;
}

.le-ruler-h {
    grid-column: 2;
    grid-row: 1;
}

.le-ruler-v {
    grid-column: 1;
    grid-row: 2;
}

.le-ruler canvas {
    display: block;
}

.le-canvas-scroll {
    grid-column: 2;
    grid-row: 2;
    overflow: auto;
    position: relative;
    cursor: default;
    background: #e0e0e0;
}

#leCanvas {
    display: block;
    background: #e0e0e0;
}

/* Canvas placeholder */
.le-canvas-placeholder {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
}

/* Document properties (right panel) */
.le-doc-properties {
    padding: 10px;
}

/* Document shape */
.le-doc-bg {
    stroke: none;
}

/* Grid */
#leGridRect {
    pointer-events: none;
}

/* Layers panel */
.le-layers {
    padding: 4px;
}

.le-layer-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.le-layer-item:hover {
    background: #e9ecef;
}

.le-layer-item.selected {
    background: #cfe2ff;
}

.le-layer-item .le-layer-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.le-layer-item .le-layer-actions {
    display: flex;
    gap: 2px;
}

.le-layer-item .le-layer-actions button {
    border: none;
    background: none;
    padding: 0 2px;
    font-size: 0.75rem;
    color: #6c757d;
    cursor: pointer;
}

.le-layer-item .le-layer-actions button:hover {
    color: #212529;
}

/* Canvas footer */
.le-canvas-footer {
    padding: 4px 8px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Selection handles */
.le-handle {
    fill: #fff;
    stroke: #0d6efd;
    stroke-width: 1;
    cursor: pointer;
}

.le-selection-box {
    fill: none;
    stroke: #0d6efd;
    stroke-width: 0.5;
    stroke-dasharray: 3 3;
    pointer-events: none;
}

/* Snap guides */
.le-snap-guide {
    stroke: #ff4081;
    stroke-width: 0.3;
    stroke-dasharray: 2 2;
    pointer-events: none;
}

/* Topbar */
.le-topbar {
    padding: 4px 0;
}
