* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    background: #0b1220;
    color: #e5e7eb;
}

a {
    text-decoration: none;
    color: inherit;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

:root {
    --definition-label-color: #cbd5e1;
    --definition-input-bg: #0f172a;
    --definition-input-border: rgba(255,255,255,0.08);
    --definition-input-text: #e5e7eb;
    --definition-input-placeholder: #94a3b8;
}

body.theme-light {
    --definition-label-color: #334155;
    --definition-input-bg: #ffffff;
    --definition-input-border: rgba(148, 163, 184, 0.4);
    --definition-input-text: #0f172a;
    --definition-input-placeholder: #64748b;
}

.sidebar {
    width: 260px;
    background: #111827;
    border-right: 1px solid rgba(255,255,255,0.06);
    padding: 40px 18px 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
}

.sidebar-logout-btn {
    width: 100%;
}

.menu-item {
    padding: 14px 16px;
    border-radius: 14px;
    color: #cbd5e1;
    transition: 0.2s ease;
}

    .menu-item:hover {
        background: #1e293b;
        color: #fff;
    }

.main-content {
    flex: 1;
    padding: 40px 24px 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 30px;
    font-weight: 700;
}

.page-subtitle {
    color: #94a3b8;
    margin-top: 6px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    background: #111827;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px 14px;
    color: #fff;
    width: 240px;
}

.user-chip {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.page-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin: 18px 0 24px;
}

.stat-card {
    background: linear-gradient(180deg, #111827, #0f172a);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 22px;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-label {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 34px;
    font-weight: 700;
    color: #fff;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    align-items: start;
}

.panel {
    background: #111827;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

    .data-table th,
    .data-table td {
        text-align: left;
        padding: 14px 12px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .data-table th {
        color: #94a3b8;
        font-size: 13px;
    }

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn,
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    cursor: pointer;
    transition: 0.2s ease;
}

    .action-btn:hover,
    .toolbar-btn:hover {
        opacity: 0.92;
    }

    .toolbar-btn.secondary {
        background: #334155;
    }

    .toolbar-btn.danger {
        background: #dc2626;
    }

.yard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.toolbar-left {
    display: flex;
    gap: 12px;
}

.legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 14px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

    .dot.empty {
        background: #22c55e;
    }

    .dot.partial {
        background: #f59e0b;
    }

    .dot.full {
        background: #ef4444;
    }

    .dot.ready {
        background: #3b82f6;
    }

.yard-layout {
    display: grid;
    grid-template-columns: 2fr 340px;
    gap: 18px;
}

.yard-grid {
    background: #111827;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.yard-cell {
    min-height: 120px;
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 18px;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: rgba(255,255,255,0.01);
}

    .yard-cell.filled {
        border-style: solid;
    }

.empty-slot {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 600;
}

.container-box {
    width: 100%;
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

    .container-box:hover {
        transform: translateY(-3px);
    }

    .container-box.empty {
        background: rgba(34, 197, 94, 0.15);
        border: 1px solid rgba(34, 197, 94, 0.4);
    }

    .container-box.partial {
        background: rgba(245, 158, 11, 0.15);
        border: 1px solid rgba(245, 158, 11, 0.4);
    }

    .container-box.full {
        background: rgba(239, 68, 68, 0.15);
        border: 1px solid rgba(239, 68, 68, 0.4);
    }

    .container-box.ready {
        background: rgba(59, 130, 246, 0.15);
        border: 1px solid rgba(59, 130, 246, 0.4);
    }

.container-no {
    font-weight: 700;
    font-size: 15px;
}

.container-type,
.container-product,
.container-fill,
.container-loc {
    font-size: 13px;
    color: #dbeafe;
}

.detail-panel {
    background: #111827;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 20px;
}

    .detail-panel h3 {
        margin-bottom: 18px;
    }

.detail-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #0f172a;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 18px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #cbd5e1;
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

    .badge.success {
        background: rgba(34,197,94,0.15);
        color: #4ade80;
    }

    .badge.danger {
        background: rgba(239,68,68,0.15);
        color: #f87171;
    }

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid,
    .yard-layout {
        display: grid;
        grid-template-columns: minmax(220px, 1fr) minmax(210px, 250px);
        gap: 14px;
        align-items: start;
    }

    .yard3d-settings-description {
        margin: 0 0 6px;
        color: #93c5fd;
        font-size: 11px;
    }

    .yard3d-toolbar-settings .yard3d-form input {
        min-height: 34px;
        padding: 6px 9px;
    }

    .yard3d-toolbar-settings .btn {
        min-height: 34px;
        padding: 7px 10px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding-top: 24px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .main-content {
        padding-top: 24px;
    }


    .yard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    .split-field {
        grid-template-columns: 1fr;
    }
}
.yard-page {
    padding: 20px 0 30px 0;
}

.yard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 4px;
}

.section-subtitle {
    color: #94a3b8;
    margin: 0 0 10px;
    font-size: 14px;
}

.yard-top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    border: none;
    border-radius: 14px;
    padding: 11px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: white;
}

.btn-secondary {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,.08);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

.btn:hover {
    transform: translateY(-1px);
    opacity: .96;
}

.yard-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255,255,255,.06);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 14px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
}

    .legend-dot.empty {
        background: #22c55e;
    }

    .legend-dot.partial {
        background: #f59e0b;
    }

    .legend-dot.full {
        background: #ef4444;
    }

    .legend-dot.ready {
        background: #3b82f6;
    }

.yard-wrapper {
    display: grid;
    grid-template-columns: 1.8fr 380px;
    gap: 18px;
    align-items: start;
}

.yard-grid-panel {
    background: rgba(2, 6, 23, .86);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,.22);
}

.yard-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(138px, 1fr));
    gap: 16px;
}

.yard-slot {
    min-height: 178px;
}

.container-card,
.empty-slot-card {
    height: 100%;
    border-radius: 20px;
    transition: all .2s ease;
}

.container-card {
    padding: 16px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.yard3d-side-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-self: start;
    max-height: calc(100vh - 160px);
}

.yard3d-toolbar-settings {
    width: 100%;
    max-width: 520px;
    justify-self: end;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.82));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.4);
}

.yard3d-settings-info h3 {
    margin-bottom: 6px;
}

.yard3d-settings-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: stretch;
}
    .yard3d-settings-actions .btn {
        width: 100%;
    }

    .container-card:hover {
        transform: translateY(-4px) scale(1.01);
        box-shadow: 0 16px 36px rgba(2,6,23,.34);
    }

    .container-card.active {
        outline: 2px solid #60a5fa;
        box-shadow: 0 0 0 4px rgba(96,165,250,.18);
    }

    .container-card.empty {
        background: linear-gradient(180deg, rgba(34,197,94,.18), rgba(34,197,94,.09));
    }

    .container-card.partial {
        background: linear-gradient(180deg, rgba(245,158,11,.20), rgba(245,158,11,.09));
    }

    .container-card.full {
        background: linear-gradient(180deg, rgba(239,68,68,.20), rgba(239,68,68,.10));
    }

    .container-card.ready {
        background: linear-gradient(180deg, rgba(59,130,246,.20), rgba(59,130,246,.10));
    }

.container-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.container-no {
    font-size: 15px;
    font-weight: 800;
    color: #f8fafc;
}

.mini-badge {
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    color: #e2e8f0;
}

.container-type {
    color: #bfdbfe;
    font-size: 13px;
    font-weight: 600;
}

.container-product {
    color: #e2e8f0;
    font-size: 13px;
    min-height: 38px;
    line-height: 1.35;
}

.fill-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,.10);
    border-radius: 999px;
    overflow: hidden;
}

.fill-bar-inner {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.container-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: #dbeafe;
}

.empty-slot-card {
    border: 1px dashed rgba(255,255,255,.14);
    background: rgba(148,163,184,.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .empty-slot-card:hover {
        background: rgba(148,163,184,.08);
    }

.empty-slot-inner {
    text-align: center;
}

.empty-slot-code {
    color: #94a3b8;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
}

.empty-slot-text {
    color: #64748b;
    font-size: 13px;
}

.yard-detail-panel {
    background: rgba(2, 6, 23, .88);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 24px;
    padding: 20px;
    position: sticky;
    top: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,.22);
}

.detail-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

    .detail-panel-header h3 {
        margin: 0;
        color: #f8fafc;
        font-size: 20px;
    }

.detail-status {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(59,130,246,.12);
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 700;
}

.detail-summary-card {
    background: linear-gradient(180deg, rgba(30,41,59,.95), rgba(15,23,42,.95));
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 18px;
}

.detail-big-code {
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.detail-small-text {
    color: #94a3b8;
    font-size: 14px;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15,23,42,.72);
    border: 1px solid rgba(255,255,255,.05);
}

    .detail-row span {
        color: #94a3b8;
        font-size: 13px;
    }

    .detail-row strong {
        color: #f8fafc;
        font-size: 13px;
        text-align: right;
        max-width: 180px;
    }

.detail-progress {
    margin-bottom: 18px;
}

.detail-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 13px;
}

.detail-progress-bar {
    height: 10px;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
}

.detail-progress-inner {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #3b82f6);
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body {
    background: radial-gradient(circle at top left, rgba(37,99,235,.20), transparent 25%), radial-gradient(circle at top right, rgba(14,165,233,.14), transparent 22%), linear-gradient(180deg, #020617 0%, #081223 100%);
    color: #e2e8f0;
}

.container,
.container-fluid,
main[role="main"] {
    background: transparent !important;
}

@media (max-width: 1200px) {
    .yard-wrapper {
        grid-template-columns: 1fr;
    }

    .yard-detail-panel {
        position: relative;
        top: 0;
    }
}

@media (max-width: 900px) {
    .yard-grid {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

@media (max-width: 640px) {
    .yard-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .section-title {
        font-size: 22px;
    }
}
.yard3d-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.yard3d-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(500px, 560px);
    align-items: start;
    gap: 16px;
}

.yard3d-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: #cbd5e1;
    font-size: 14px;
}

.legend-box {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 3px;
    margin-right: 6px;
}

    .legend-box.empty {
        background: #22c55e;
    }

    .legend-box.partial {
        background: #f59e0b;
    }

    .legend-box.full {
        background: #ef4444;
    }

    .legend-box.ready {
        background: #3b82f6;
    }

.yard3d-info {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.72));
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 12px 14px;
    color: #e2e8f0;
    min-width: 320px;
    line-height: 1.55;
}

#threeContainer {
    width: 100%;
    height: calc(100vh - 280px);
    min-height: 560px;
    max-height: 720px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: radial-gradient(circle at 25% 12%, #102548 0%, #081223 45%, #040a14 100%);
    box-shadow: 0 20px 48px rgba(2, 6, 23, 0.45), inset 0 0 0 1px rgba(255,255,255,0.04);
}

    #threeContainer canvas {
        display: block;
        width: 100% !important;
        height: 100% !important;
    }

.yard3d-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    gap: 18px;
    align-items: start;
}
.yard3d-main-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.yard3d-settings-panel {
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.82));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.4);
}

    .yard3d-settings-panel h3 {
        margin-bottom: 10px;
    }

    .yard3d-settings-panel .btn {
        width: 100%;
    }

.yard3d-toolbar-settings .yard3d-settings-layout {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) minmax(200px, 230px);
    gap: 12px;
    align-items: start;
}


.yard3d-panel {
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.82));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.4);
    max-height: none;
    overflow-y: auto;
    flex: 1;
}

    .yard3d-panel h3 {
        margin-bottom: 10px;
    }

.yard3d-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .yard3d-form label {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 13px;
        color: #cbd5e1;
    }

    .yard3d-form input,
    .yard3d-form select {
        border: 1px solid rgba(255,255,255,0.12);
        background: rgba(15, 23, 42, 0.9);
        border-radius: 10px;
        color: #f8fafc;
        padding: 9px 10px;
        transition: border-color .2s ease, box-shadow .2s ease;
    }

        .yard3d-form input:focus,
        .yard3d-form select:focus {
            outline: none;
            border-color: rgba(59, 130, 246, 0.85);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
        }

.yard3d-form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.yard3d-panel .btn {
    width: 100%;
}

.yard3d-form-actions .btn {
    flex: 1 1 140px;
}

.yard3d-selected-info {
    margin-top: 12px;
    color: #93c5fd;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-line;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
}

@media (max-width: 1100px) {
    .yard3d-toolbar {
        grid-template-columns: 1fr;
    }
    .yard3d-workspace {
        grid-template-columns: 1fr;
    }
    .yard3d-side-column { 
        max-height: none;
    }
    .yard3d-toolbar-settings {
        max-width: none;
        justify-self: stretch;
    }
        .yard3d-toolbar-settings .yard3d-settings-layout {
            grid-template-columns: 1fr;
        }

    #threeContainer {
        height: calc(100vh - 320px);
        min-height: 420px;
    }

    .yard3d-panel {
        max-height: none;
        overflow-y: visible;
    }
}
.yard3d-move-info {
    margin-top: 8px;
    color: #fbbf24;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-line;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 10px;
    padding: 9px 12px;
}

#moveBoxBtn.active {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #fff;
}
.yard3d-popup-host {
    position: fixed;
    top: 18px;
    right: 24px;
    z-index: 2200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.yard3d-popup {
    min-width: 320px;
    max-width: 420px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-left: 4px solid #38bdf8;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.58);
    padding: 12px 14px;
    color: #e2e8f0;
    pointer-events: auto;
    animation: yard3dPopupIn .2s ease-out;
}

.yard3d-popup--warning {
    border-left-color: #f59e0b;
}

.yard3d-popup--error {
    border-left-color: #ef4444;
}

.yard3d-popup__title {
    font-size: 13px;
    font-weight: 700;
    color: #bae6fd;
    margin-bottom: 6px;
}

.yard3d-popup__message {
    font-size: 13px;
    line-height: 1.45;
}

.yard3d-popup__close {
    margin-top: 10px;
    border: 0;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.22);
    color: #e0f2fe;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}

@keyframes yard3dPopupIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
:root {
    --bg-primary: #f3f4f6;
    --bg-elevated: #ffffff;
    --bg-sidebar: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    color: var(--text-primary);
}
    body.theme-light .yard3d-form input,
    body.theme-light .yard3d-form select,
    body.theme-light .btn-secondary,
    body.theme-light .btn-danger,
    body.theme-light .theme-toggle {
        background: #ffffff;
        color: #0f172a;
        border-color: var(--border-color);
    }

        body.theme-light .yard3d-form input::placeholder {
            color: #64748b;
        }

        body.theme-light .yard3d-form input:focus,
        body.theme-light .yard3d-form select:focus {
            border-color: rgba(59, 130, 246, 0.55);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
        }

    body.theme-light .sidebar,
    body.theme-light .panel,
    body.theme-light .yard-grid-panel,
    body.theme-light .yard-detail-panel,
    body.theme-light .detail-panel,
    body.theme-light .yard3d-panel,
    body.theme-light .yard3d-settings-panel {
        background: var(--bg-elevated);
        border-color: var(--border-color);
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    }

    body.theme-light .brand-subtitle,
    body.theme-light .page-subtitle,
    body.theme-light .section-subtitle,
    body.theme-light .legend-item,
    body.theme-light .yard3d-legend,
    body.theme-light .empty-slot-code,
    body.theme-light .empty-slot-text,
    body.theme-light .detail-small-text,
    body.theme-light .detail-row span,
    body.theme-light .container-footer {
        color: var(--text-secondary);
    }

    body.theme-light .brand-title,
    body.theme-light .section-title,
    body.theme-light .container-no,
    body.theme-light .detail-big-code,
    body.theme-light .detail-row strong,
    body.theme-light .stat-value,
    body.theme-light .panel-header,
    body.theme-light .yard3d-info {
        color: var(--text-primary);
    }

    body.theme-light .menu-item {
        color: #334155;
    }

        body.theme-light .menu-item:hover {
            background: #e2e8f0;
            color: #0f172a;
        }

    body.theme-light .search-box {
        background: #ffffff;
        border: 1px solid var(--border-color);
        color: #0f172a;
    }

    body.theme-light .stat-card,
    body.theme-light .detail-summary-card,
    body.theme-light .detail-row,
    body.theme-light .yard-legend,
    body.theme-light .yard3d-info {
        background: #ffffff;
        border: 1px solid var(--border-color);
    }

    body.theme-light .data-table th,
    body.theme-light .data-table td {
        border-bottom-color: var(--border-color);
    }

    body.theme-light .data-table th {
        color: #64748b;
    }

    body.theme-light .container-type,
    body.theme-light .container-product,
    body.theme-light .container-fill,
    body.theme-light .container-loc,
    body.theme-light .mini-badge {
        color: #334155;
    }

    body.theme-light .mini-badge {
        background: #e2e8f0;
    }

    body.theme-light .fill-bar {
        background: #e2e8f0;
    }

    body.theme-light .empty-slot-card {
        border-color: rgba(15, 23, 42, 0.2);
        background: #f8fafc;
    }

    body.theme-light #threeContainer {
        border-color: rgba(148, 163, 184, 0.2);
        background: radial-gradient(circle at 25% 12%, #102548 0%, #081223 45%, #040a14 100%);
        box-shadow: 0 20px 48px rgba(2, 6, 23, 0.45), inset 0 0 0 1px rgba(255,255,255,0.04);
    }

.theme-toggle {
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: #0f172a;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all .2s ease;
}

body.theme-dark .theme-toggle {
    background: #1e293b;
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.1);
}

body.theme-dark {
    background: radial-gradient(circle at top left, rgba(37,99,235,.20), transparent 25%), radial-gradient(circle at top right, rgba(14,165,233,.14), transparent 22%), linear-gradient(180deg, #020617 0%, #081223 100%);
    color: #e2e8f0;
}
.definition-form {
    margin-top: 18px;
}

.form-grid {
    display: grid;
    gap: 14px;
}

    .form-grid.two-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--definition-label-color);
    font-size: 14px;
}

    .form-field input,
    .form-field select,
    .form-field textarea {
        background: var(--definition-input-bg);
        border: 1px solid var(--definition-input-border);
        color: var(--definition-input-text);
        border-radius: 12px;
        padding: 11px 12px;
        outline: none;
    }
        .form-field input::placeholder,
        .form-field textarea::placeholder {
            color: var(--definition-input-placeholder);
        }
        .form-field input:focus,
        .form-field select:focus,
        .form-field textarea:focus {
            border-color: #2563eb;
        }

    .form-field.full-width {
        grid-column: 1 / -1;
    }

.form-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}
.split-field {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

    .split-field input,
    .split-field select {
        width: 100%;
    }
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top left, rgba(37,99,235,.20), transparent 25%), linear-gradient(180deg, #020617 0%, #081223 100%);
}

.login-card {
    width: min(420px, 92vw);
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    padding: 24px;
    color: #e2e8f0;
}

    .login-card h1 {
        margin: 0 0 6px;
    }

    .login-card p {
        margin: 0 0 14px;
        color: #94a3b8;
    }

.text-danger {
    color: #fca5a5;
    font-size: 13px;
}
.yard3d-created-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 16px;
}

.yard3d-created-item {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 8px;
    display: grid;
    gap: 6px;
    font-size: 12px;
}

.yard3d-modal[hidden] {
    display: none;
}

.yard3d-modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    z-index: 2400;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.yard3d-toolbar-title {
    min-width: 0;
}

.yard3d-modal__content {
    width: min(560px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 18px;
}
.report-filters {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-wrap {
    margin-top: 16px;
    overflow-x: auto;
}

@media (max-width: 1100px) {
    .report-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .report-filters {
        grid-template-columns: 1fr;
    }
}

.definition-modal[hidden] {
    display: none;
}

.definition-modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.65);
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.definition-modal__content {
    width: min(920px, 100%);
    max-height: 90vh;
    overflow-y: auto;
}
.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.yard3d-selected-info strong {
    display: block;
    color: #e2e8f0;
    font-size: 14px;
    margin-bottom: 4px;
}

.yard3d-selected-info span {
    display: block;
    color: #93c5fd;
}

.yard3d-selected-details {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

    .yard3d-selected-details > div {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 10px;
        border-radius: 10px;
        border: 1px solid rgba(148, 163, 184, 0.2);
        background: rgba(15, 23, 42, 0.35);
        font-size: 12px;
    }

    .yard3d-selected-details span {
        color: #93c5fd;
    }

    .yard3d-selected-details strong {
        color: #f8fafc;
        text-align: right;
    }