:root {
    --bg-color: #08111f;
    --sidebar-bg: rgba(13, 22, 36, 0.94);
    --card-bg: rgba(12, 20, 32, 0.86);
    --text-primary: #e8eef8;
    --text-secondary: #93a1b7;
    --text-dark: #132238;
    --muted-dark: #5b6b7d;
    --accent: #4f9bff;
    --accent-hover: #2f81f7;
    --danger: #f85149;
    --danger-hover: #da3633;
    --warning: #d29922;
    --success: #18a874;
    --border: rgba(140, 164, 196, 0.18);
    --glass-border: rgba(255, 255, 255, 0.08);
    --slot-20ft: #0f78ff;
    --slot-40ft: #ff9a1a;
    --slot-45ft: #ff5560;
    --slot-empty: #e9eff6;
    --panel-gap: 1.15rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    color: var(--text-primary);
    background: radial-gradient(circle at top right, rgba(47, 129, 247, 0.18), transparent 30%), linear-gradient(180deg, #06101b 0%, #08111f 100%);
}

button, input, select {
    font: inherit;
}

.hidden {
    display: none !important;
}

.app-shell-hidden {
    opacity: 0.16;
    pointer-events: none;
    filter: blur(4px);
}

.glass {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(20px);
}

.auth-screen {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(2, 10, 18, 0.82);
    backdrop-filter: blur(18px);
    z-index: 1200;
}

.auth-screen.active {
    display: flex;
}

.auth-card,
.modal-card {
    width: min(100%, 560px);
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(10, 19, 31, 0.98), rgba(14, 24, 39, 0.98));
    box-shadow: 0 32px 70px rgba(0, 0, 0, 0.35);
}

.auth-copy h1 {
    font-size: 2rem;
    line-height: 1.08;
    margin: 0.35rem 0 0.75rem;
}

.auth-copy p,
.header-subtitle {
    color: var(--text-secondary);
    line-height: 1.55;
}

.auth-kicker,
.brand-kicker,
.user-badge-label,
.detail-label,
.viewport-label {
    display: inline-flex;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
}

.auth-kicker {
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    background: rgba(79, 155, 255, 0.14);
    color: #8bbcff;
    font-weight: 700;
}

.auth-form,
.settings-form {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.compact-form {
    gap: 0.7rem;
}

.demo-users {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.demo-user-btn,
.badge-action-btn,
.mini-nav-btn,
.btn-primary,
.btn-danger,
.btn-secondary {
    transition: 0.18s ease;
}

.demo-user-btn {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    padding: 0.75rem 0.85rem;
    text-align: left;
    cursor: pointer;
}

.demo-user-btn:hover {
    background: rgba(79, 155, 255, 0.08);
    border-color: rgba(79, 155, 255, 0.22);
}

.auth-error {
    margin-top: 0.8rem;
    color: #ff8f87;
    font-size: 0.9rem;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1300;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 10, 18, 0.64);
}

.modal-card {
    position: relative;
    z-index: 1;
}

.move-modal-card {
    width: min(100%, 560px);
    padding: 1.7rem;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(10, 20, 35, 0.98), rgba(13, 24, 41, 0.99));
    box-shadow: 0 34px 80px rgba(0, 0, 0, 0.42);
}

.move-summary-grid,
.form-grid,
.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.move-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
    margin-top: 1.35rem;
    align-items: stretch;
}

.move-modal-card .panel-heading {
    margin-bottom: 1rem;
}

.move-modal-card .panel-heading h2 {
    color: #f7fbff;
    font-size: 1.3rem;
}

.move-modal-card .panel-heading p {
    color: #93a6c2;
}

.move-modal-card .detail-card,
.move-modal-card .detail-section {
    background: linear-gradient(180deg, rgba(242, 246, 252, 0.98), rgba(232, 239, 248, 0.97));
    border: 1px solid rgba(159, 179, 205, 0.22);
}

.move-modal-card .detail-card {
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.move-modal-card .detail-card strong {
    font-size: 1.05rem;
}

.move-modal-card .detail-card small {
    font-size: 0.84rem;
}

.move-modal-card .detail-section {
    padding: 0.9rem 1rem 1rem;
    margin-top: 0.35rem;
}

.move-modal-card .history-list {
    gap: 0.75rem;
    max-height: none;
    padding-top: 0.55rem;
}

.move-rule-item {
    width: calc(100% - 16px);
    margin-inline: auto;
    padding: 0.82rem 0.9rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(159, 179, 205, 0.18);
}

.move-rule-item strong,
.move-rule-item span,
.move-rule-item small {
    display: block;
}

.move-rule-item strong {
    color: #52657e;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
}

.move-rule-item span {
    color: #18263c;
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 0.16rem;
}

.move-rule-item small {
    color: #6b7d95;
    font-size: 0.76rem;
}

.move-modal-actions .modal-submit {
    margin-top: 0;
    min-height: 72px;
    width: 100%;
    border-radius: 22px;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: 1.35rem;
}

.move-modal-actions .btn-secondary.modal-submit {
    background: linear-gradient(180deg, rgba(54, 66, 85, 0.98), rgba(43, 53, 69, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f6f9fd;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.move-modal-actions .btn-primary.modal-submit {
    background: linear-gradient(135deg, #4f98ff, #2f7df6);
    box-shadow: 0 16px 30px rgba(47, 129, 247, 0.22);
}

.move-modal-actions .btn-secondary.modal-submit:hover,
.move-modal-actions .btn-primary.modal-submit:hover {
    transform: translateY(-1px);
}

.toggle-card {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.toggle-card input {
    margin-top: 0.2rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.compact-toggle {
    padding: 0.75rem 0.8rem;
}

.app-container {
    display: flex;
    width: 100%;
}

.sidebar {
    width: 280px;
    padding: 0.8rem 0 1.2rem;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease, padding 0.2s ease;
}

.sidebar-topbar {
    display: flex;
    justify-content: flex-end;
    padding: 0 1rem 0.6rem;
}

.sidebar-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    cursor: pointer;
    transition: 0.18s ease;
}

.sidebar-toggle-btn:hover {
    border-color: rgba(79, 155, 255, 0.36);
    background: rgba(79, 155, 255, 0.12);
}

.brand-lockup {
    padding: 0 1.2rem 1rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: padding 0.2s ease;
}

.brand-logo {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 0.75rem;
}

.brand-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.brand-meta strong {
    font-size: 1rem;
    font-weight: 700;
    color: #f6fbff;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.nav-links li {
    padding: 0.9rem 1.3rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    transition: padding 0.2s ease, gap 0.2s ease;
}

.nav-links li:hover,
.nav-links li.active {
    color: var(--text-primary);
    background: rgba(79, 155, 255, 0.12);
    border-right: 4px solid var(--accent);
}

.nav-links li i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex: 0 0 20px;
}

.nav-label {
    white-space: nowrap;
}

.sidebar-credit {
    margin: auto 1.6rem 0;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    transition: opacity 0.2s ease, margin 0.2s ease;
}

.sidebar-credit span {
    font-size: 0.8rem;
    font-weight: 600;
}

.sidebar-credit small {
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.content {
    flex: 1;
    padding: 1.1rem 1.5rem 1.5rem;
    overflow-y: auto;
}

.app-header {
    display: flex;
    justify-content: flex-start;
    align-items: start;
    gap: 0.6rem;
    margin-bottom: 0.22rem;
    padding: 0.08rem 0 0.08rem;
}

.app-header h1 {
    font-size: 1.68rem;
    font-weight: 700;
    line-height: 1.05;
}

.header-copy {
    display: flex;
    flex-direction: column;
    gap: 0.02rem;
    min-width: 0;
}

.header-kicker {
    display: inline-flex;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-secondary);
}

.dashboard-overview-panel {
    min-width: 0;
}

.dashboard-side-stack {
    display: grid;
    gap: calc(var(--panel-gap) - 0.25rem);
    align-content: start;
    padding: 1rem;
}

.header-stats-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.header-stat-pill {
    min-width: 78px;
    padding: 0.42rem 0.65rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 21, 34, 0.72);
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.45rem;
}

.header-stat-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
}

.header-stat-pill strong {
    font-size: 1rem;
    line-height: 1.05;
}

.compact-header-actions {
    margin: 0;
    gap: 0.45rem;
    justify-content: stretch;
}

.compact-header-actions .btn-secondary {
    padding: 0.68rem 0.84rem;
    min-height: 40px;
    width: 100%;
}

.compact-session {
    min-width: 0;
    padding: 0.5rem 0.72rem;
    gap: 0.55rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.user-badge {
    min-width: 180px;
    padding: 0.72rem 0.9rem;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    background: rgba(15, 27, 42, 0.88);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: flex-end;
}

.user-badge strong { font-size: 0.94rem; }
.user-badge small { color: #7dd3a8; font-size: 0.78rem; }

.compact-session-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.08rem;
}

.compact-session-secondary {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-badge-actions {
    display: inline-flex;
    gap: 0.45rem;
    margin-top: 0;
}

.badge-action-btn,
.mini-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
}

.badge-action-btn:hover,
.mini-nav-btn:hover {
    border-color: rgba(79, 155, 255, 0.32);
    background: rgba(79, 155, 255, 0.12);
}

.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content.active.dashboard-layout { display: flex; }
.mt-4 { margin-top: 1.5rem; }

.dashboard-layout {
    flex-direction: column;
    gap: var(--panel-gap);
}

.dashboard-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-bottom: 0.1rem;
}

.card {
    padding: 0.82rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.72rem;
}

.card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(79, 155, 255, 0.16);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.card-icon.warning { background: rgba(210, 153, 34, 0.16); color: var(--warning); }
.card-icon.accent-alt { background: rgba(24, 168, 116, 0.16); color: var(--success); }

.card-info h3 { font-size: 0.84rem; color: var(--text-secondary); margin-bottom: 0.2rem; font-weight: 600; }
.card-info p { font-size: 1.2rem; font-weight: 700; }

.compact-workspace {
    margin-top: 0;
}

.top-workspace {
    align-items: start;
}

.main-column-stack {
    display: flex;
    flex-direction: column;
    gap: var(--panel-gap);
}

.inventory-inline-panel {
    margin-top: 0;
}

.app-shell.sidebar-collapsed .sidebar {
    width: 82px;
    padding-bottom: 1rem;
}

.app-shell.sidebar-collapsed .sidebar-topbar {
    justify-content: center;
    padding: 0 0 0.55rem;
}

.app-shell.sidebar-collapsed .brand-lockup {
    padding: 0 0.7rem 0.85rem;
    margin-bottom: 0.7rem;
}

.app-shell.sidebar-collapsed .brand-logo {
    margin-bottom: 0;
}

.app-shell.sidebar-collapsed .brand-meta,
.app-shell.sidebar-collapsed .sidebar-credit,
.app-shell.sidebar-collapsed .nav-label {
    display: none;
}

.app-shell.sidebar-collapsed .nav-links li {
    justify-content: center;
    padding: 0.9rem 0;
    gap: 0;
}

.app-shell.sidebar-collapsed .nav-links li:hover,
.app-shell.sidebar-collapsed .nav-links li.active {
    border-right-width: 0;
    box-shadow: inset 3px 0 0 var(--accent);
}

.map-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--panel-gap);
    align-items: start;
}

.map-column { min-width: 0; }

.map-panel,
.bay-panel,
.inspector-panel,
.inventory-table-container,
.form-container {
    padding: 1.15rem;
    color: var(--text-dark);
    background: linear-gradient(180deg, rgba(246, 249, 252, 0.98), rgba(235, 241, 247, 0.98));
    border: 1px solid rgba(140, 164, 196, 0.22);
    box-shadow: 0 10px 24px rgba(31, 55, 86, 0.08);
    backdrop-filter: none;
    contain: layout paint;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.panel-heading h2 { font-size: 1.08rem; color: var(--text-dark); }
.panel-heading p { color: var(--muted-dark); font-size: 0.84rem; line-height: 1.45; margin-top: 0.25rem; }

.map-legend { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-dark);
    border: 1px solid rgba(140, 164, 196, 0.2);
    font-size: 0.76rem;
    font-weight: 600;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.type-20ft { background: var(--slot-20ft); box-shadow: 0 0 0 3px rgba(15, 120, 255, 0.16); }
.legend-dot.type-40ft { background: var(--slot-40ft); box-shadow: 0 0 0 3px rgba(255, 154, 26, 0.16); }
.legend-dot.type-45ft { background: var(--slot-45ft); box-shadow: 0 0 0 3px rgba(255, 85, 96, 0.16); }
.legend-dot.type-empty { background: var(--slot-empty); box-shadow: 0 0 0 3px rgba(140, 164, 196, 0.12); }

.terminal-overview {
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(420px, 1.45fr);
    gap: 1rem;
    align-items: stretch;
}

.terminal-block {
    border: 1px solid rgba(140, 164, 196, 0.2);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(242, 246, 251, 0.95));
    padding: 1rem;
    color: var(--text-dark);
    text-align: left;
    cursor: pointer;
    min-width: 0;
    max-width: none;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.terminal-block:hover,
.terminal-block.active {
    border-color: rgba(79, 155, 255, 0.6);
    box-shadow: 0 10px 18px rgba(79, 155, 255, 0.1);
}

.terminal-block-top,
.terminal-block-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.terminal-block-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.terminal-block-kicker {
    color: var(--muted-dark);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.terminal-block strong { font-size: 1.35rem; }
.terminal-block small { display: block; color: var(--muted-dark); font-size: 0.76rem; }

.terminal-block-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.18rem;
    text-align: right;
}

.terminal-block-ratio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    background: rgba(79, 155, 255, 0.12);
    color: #1e5da8;
    font-size: 0.82rem;
    font-weight: 700;
}

.terminal-block-track {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--muted-dark);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.terminal-block-track-line {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background:
        linear-gradient(90deg, rgba(138, 152, 171, 0.55) 0 8%, transparent 8% 12%, rgba(138, 152, 171, 0.55) 12% 20%, transparent 20% 24%, rgba(138, 152, 171, 0.55) 24% 32%, transparent 32% 36%, rgba(138, 152, 171, 0.55) 36% 44%, transparent 44% 48%, rgba(138, 152, 171, 0.55) 48% 56%, transparent 56% 60%, rgba(138, 152, 171, 0.55) 60% 68%, transparent 68% 72%, rgba(138, 152, 171, 0.55) 72% 80%, transparent 80% 84%, rgba(138, 152, 171, 0.55) 84% 100%);
    opacity: 0.85;
}

.terminal-block-footprint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.24rem 0.55rem;
    border-radius: 999px;
    background: rgba(19, 34, 56, 0.06);
    white-space: nowrap;
}

.terminal-block-grid {
    display: grid;
    grid-template-columns: repeat(var(--mini-columns, 8), minmax(0, 1fr));
    grid-auto-rows: var(--mini-row-height, 16px);
    gap: var(--mini-gap, 0.22rem);
    padding: 0.85rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(235, 241, 248, 0.96));
    border: 1px solid rgba(140, 164, 196, 0.18);
    align-content: start;
    min-height: var(--mini-min-height, 112px);
}

.terminal-block-grid.dense-overview-grid {
    padding: 0.72rem;
}

.terminal-block-footer {
    margin-top: auto;
    color: var(--muted-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.mini-cell {
    min-height: 16px;
    border-radius: 5px;
    background: var(--slot-empty);
    border: 1px solid rgba(140, 164, 196, 0.16);
}
.mini-cell.type-20ft { background: rgba(15, 120, 255, 0.95); }
.mini-cell.type-40ft { background: rgba(255, 154, 26, 0.95); }
.mini-cell.type-45ft { background: rgba(255, 85, 96, 0.95); }
.mini-cell.wide { grid-column: span 2; border-radius: 8px; }
.mini-cell.dense-part { border-radius: 4px; }
.mini-cell.type-disabled {
    background: repeating-linear-gradient(135deg, rgba(180, 191, 204, 0.65), rgba(180, 191, 204, 0.65) 4px, rgba(234, 239, 245, 0.9) 4px, rgba(234, 239, 245, 0.9) 8px);
}

.bay-toolbar { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: flex-end; }
.toolbar-group { display: flex; flex-direction: column; gap: 0.45rem; min-width: 100px; }
.toolbar-group label,
label { color: var(--text-secondary); font-size: 0.84rem; font-weight: 600; }

input, select {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(140, 164, 196, 0.25);
    border-radius: 14px;
    padding: 0.82rem 0.95rem;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-dark);
    outline: none;
}

.viewport-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
    padding: 0.65rem 0.8rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(140, 164, 196, 0.18);
    color: var(--text-dark);
    flex-wrap: wrap;
}

.viewport-nav { display: inline-flex; align-items: center; gap: 0.55rem; }
.viewport-summary { color: var(--muted-dark); font-size: 0.78rem; font-weight: 600; }
.viewport-jump { display: inline-flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.viewport-jump input { width: 74px; padding: 0.6rem 0.65rem; border-radius: 12px; font-size: 0.82rem; }
.jump-btn { width: 38px; height: 38px; }

.bay-grid {
    display: grid;
    gap: 0.55rem;
    align-items: stretch;
}

.bay-grid.compact-grid {
    gap: 0.35rem;
}

.bay-grid.condensed-grid {
    gap: 0.28rem;
}

.axis-cell,
.bay-header-cell,
.row-header-cell {
    min-height: 44px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(220, 231, 246, 0.94), rgba(201, 216, 236, 0.98));
    border: 1px solid rgba(102, 129, 165, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 8px 16px rgba(125, 146, 175, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #41536b;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    justify-self: center;
    align-self: center;
    width: calc(100% - 28px);
    height: 30px;
}

.bay-grid.compact-grid .axis-cell,
.bay-grid.compact-grid .bay-header-cell,
.bay-grid.compact-grid .row-header-cell {
    min-height: 34px;
    border-radius: 10px;
    font-size: 0.54rem;
    width: calc(100% - 16px);
    height: 24px;
}

.axis-cell {
    width: calc(100% - 18px);
}

.row-header-cell {
    width: calc(100% - 26px);
}

.bay-header-cell {
    width: calc(100% - 30px);
}

.slot-cell {
    position: relative;
    min-height: 0;
    border: 1px solid rgba(140, 164, 196, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    text-align: left;
    padding: 0.7rem 0.75rem;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.bay-grid.compact-grid .slot-cell {
    padding: 0.42rem 0.42rem 0.38rem;
    border-radius: 12px;
}

.bay-grid.condensed-grid .slot-cell {
    padding: 0.32rem 0.32rem 0.3rem;
    border-radius: 12px;
    justify-content: center;
}

.slot-cell.is-draggable { cursor: grab; }
.slot-cell:hover { box-shadow: 0 8px 14px rgba(19, 34, 56, 0.06); }
.slot-cell.is-selected { border-color: rgba(79, 155, 255, 0.72); box-shadow: 0 0 0 3px rgba(79, 155, 255, 0.14); }
.slot-cell.is-drop-target { border-color: rgba(24, 168, 116, 0.72); box-shadow: 0 0 0 3px rgba(24, 168, 116, 0.14); }
.slot-cell.is-drop-candidate:not(.is-disabled) { border-color: rgba(24, 168, 116, 0.36); }
.slot-cell.is-disabled { background: repeating-linear-gradient(135deg, rgba(220, 227, 236, 0.92), rgba(220, 227, 236, 0.92) 10px, rgba(245, 248, 252, 0.96) 10px, rgba(245, 248, 252, 0.96) 20px) !important; }
.slot-cell.parity-odd.type-empty,
.slot-cell.parity-even.type-empty { background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 254, 0.96)); }
.slot-cell.type-20ft { background: linear-gradient(180deg, rgba(15, 120, 255, 0.38), rgba(15, 120, 255, 0.14) 54%, rgba(255, 255, 255, 0.98)); }
.slot-cell.type-40ft { background: linear-gradient(180deg, rgba(255, 154, 26, 0.38), rgba(255, 154, 26, 0.14) 54%, rgba(255, 255, 255, 0.98)); }
.slot-cell.type-45ft { background: linear-gradient(180deg, rgba(255, 85, 96, 0.38), rgba(255, 85, 96, 0.14) 54%, rgba(255, 255, 255, 0.98)); }
.slot-code { display: block; color: var(--muted-dark); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.35rem; }
.slot-title { display: block; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.18rem; }
.slot-cell.type-20ft .slot-title { color: #005ccf; }
.slot-cell.type-40ft .slot-title { color: #b55e00; }
.slot-cell.type-45ft .slot-title { color: #c42130; }
.slot-meta { display: block; color: var(--muted-dark); font-size: 0.74rem; max-width: calc(100% - 42px); line-height: 1.35; }
.slot-stack { position: absolute; top: 0.6rem; right: 0.6rem; min-width: 30px; padding: 0.22rem 0.45rem; border-radius: 999px; background: rgba(19, 34, 56, 0.08); color: var(--text-dark); font-size: 0.72rem; font-weight: 700; }
.slot-cell.wide { border-radius: 20px; }

.bay-grid.compact-grid .slot-code {
    font-size: 0.52rem;
    margin-bottom: 0.18rem;
}

.bay-grid.compact-grid .slot-title {
    font-size: 0.7rem;
    margin-bottom: 0.08rem;
}

.bay-grid.compact-grid .slot-meta {
    font-size: 0.56rem;
    max-width: calc(100% - 26px);
    line-height: 1.2;
}

.bay-grid.compact-grid .slot-stack {
    top: 0.28rem;
    right: 0.28rem;
    min-width: 22px;
    padding: 0.1rem 0.24rem;
    font-size: 0.55rem;
}

.bay-grid.condensed-grid .slot-title {
    font-size: 0.54rem;
    margin: 0;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.bay-grid.condensed-grid .slot-stack {
    top: 0.18rem;
    right: 0.18rem;
    min-width: 18px;
    padding: 0.08rem 0.18rem;
    font-size: 0.48rem;
}

.slot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(19, 34, 56, 0.08);
    color: var(--text-dark);
}

.slot-badge.type-20ft { background: rgba(15, 120, 255, 0.18); color: #005ccf; }
.slot-badge.type-40ft { background: rgba(255, 154, 26, 0.2); color: #b55e00; }
.slot-badge.type-45ft { background: rgba(255, 85, 96, 0.2); color: #c42130; }

.inspector-panel { min-height: 100%; position: sticky; top: 1rem; }
.inspector-empty,
.detail-card,
.container-card,
.detail-section {
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(140, 164, 196, 0.16);
}

.inspector-empty { line-height: 1.6; color: var(--muted-dark); }
.detail-card strong,
.container-card strong { display: block; font-size: 1rem; color: var(--text-dark); margin-bottom: 0.2rem; }
.detail-card small,
.container-card small { display: block; color: var(--muted-dark); line-height: 1.45; }
.stack-layers,
.history-list { display: flex; flex-direction: column; gap: 0.65rem; }
.history-list { max-height: 220px; overflow: auto; }
.target-move-widget {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.target-move-header {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.target-move-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.target-move-helper {
    display: block;
    color: var(--muted-dark);
    line-height: 1.45;
}

.target-move-feedback {
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(140, 164, 196, 0.18);
    background: rgba(244, 247, 251, 0.96);
    color: var(--muted-dark);
    font-size: 0.82rem;
    line-height: 1.4;
}

.target-move-feedback.success {
    background: rgba(24, 168, 116, 0.08);
    border-color: rgba(24, 168, 116, 0.24);
    color: #15734d;
}

.target-move-feedback.error {
    background: rgba(224, 70, 88, 0.08);
    border-color: rgba(224, 70, 88, 0.24);
    color: #b4232d;
}

.target-move-submit {
    margin-top: 0;
}

.history-item,
.layer-empty,
.history-empty {
    padding: 0.85rem 0.9rem;
    border-radius: 15px;
    background: rgba(244, 247, 251, 0.96);
    border: 1px solid rgba(140, 164, 196, 0.16);
    color: var(--muted-dark);
}
.layer-item {
    width: 100%;
    border: 1px solid rgba(140, 164, 196, 0.18);
    border-radius: 15px;
    background: rgba(244, 247, 251, 0.96);
    padding: 0.8rem 0.85rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: center;
    text-align: left;
    color: var(--text-dark);
    cursor: pointer;
}
.layer-item.active,
.layer-item:hover { border-color: rgba(79, 155, 255, 0.55); background: rgba(79, 155, 255, 0.08); }
.layer-tier { padding: 0.28rem 0.55rem; border-radius: 999px; background: rgba(19, 34, 56, 0.08); font-size: 0.74rem; font-weight: 700; }

.inspector-actions { display: grid; gap: 0.75rem; }

.form-container { max-width: 900px; }
.form-container h2 { margin-bottom: 1.5rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--border); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.form-group.full-width { grid-column: 1 / -1; }
.form-title { grid-column: 1 / -1; margin-top: 0.4rem; color: var(--accent); font-weight: 700; }

.position-group {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 0.7fr 0.7fr;
    gap: 0.8rem;
    padding: 0.9rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(140, 164, 196, 0.18);
}
.position-group > div { display: flex; flex-direction: column; gap: 0.38rem; min-width: 0; }
.position-group label { color: #7f92ab; font-size: 0.76rem; font-weight: 700; line-height: 1.1; }

.btn-primary,
.btn-danger,
.btn-secondary {
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 700;
}

.btn-primary,
.btn-danger {
    margin-top: 1.35rem;
    width: 100%;
    padding: 0.95rem 1.2rem;
    color: #ffffff;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); }
.btn-danger { background: linear-gradient(135deg, var(--danger), var(--danger-hover)); }
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.inspector-btn,
.modal-submit { width: 100%; }
.btn-primary:disabled,
.btn-danger:disabled,
.btn-secondary:disabled,
.badge-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.activity-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(15, 25, 40, 0.74);
    border: 1px solid rgba(88, 132, 196, 0.22);
    color: #d9e6f8;
    box-shadow: 0 18px 36px rgba(3, 10, 20, 0.26);
}

.activity-spinner {
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    animation: activity-spin 0.8s linear infinite;
}

@keyframes activity-spin {
    to { transform: rotate(360deg); }
}

.btn-primary.is-loading,
.btn-danger.is-loading,
.btn-secondary.is-loading,
.badge-action-btn.is-loading {
    position: relative;
}

.btn-primary.is-loading::after,
.btn-danger.is-loading::after,
.btn-secondary.is-loading::after,
.badge-action-btn.is-loading::after {
    content: "";
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: currentColor;
    animation: activity-spin 0.8s linear infinite;
}

.table-scroll { max-height: 420px; overflow: auto; }
.modern-table { width: 100%; border-collapse: collapse; }
.modern-table th, .modern-table td { padding: 0.95rem; text-align: left; border-bottom: 1px solid var(--border); }
.modern-table th { color: var(--text-secondary); font-size: 0.88rem; font-weight: 600; }
.modern-table tbody tr { cursor: pointer; }
.modern-table tbody tr:hover { background: rgba(79, 155, 255, 0.08); }
.modern-table tbody tr td small { color: var(--muted-dark); }
.tag {
    display: inline-flex;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(79, 155, 255, 0.14);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
}

.toast {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    padding: 1rem 1.2rem;
    border-radius: 16px;
    color: #fff;
    font-weight: 700;
    opacity: 0;
    transform: translateY(90px);
    transition: 0.25s ease;
    z-index: 2000;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: linear-gradient(135deg, #1f9d6a, #15734d); }
.toast.error { background: linear-gradient(135deg, var(--danger), var(--danger-hover)); }

@media (max-width: 1280px) {
    .map-workspace { grid-template-columns: 1fr; }
    .inspector-panel { position: static; }
    .terminal-overview { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; }
    .content { padding: 1rem; }
    .stats-cards,
    .form-grid,
    .position-group,
    .target-move-grid,
    .move-summary-grid,
    .move-modal-actions,
    .checkbox-grid { grid-template-columns: 1fr; }
    .table-scroll { overflow-x: auto; }
}
