:root {
    --admin-sidebar: #182433;
    --admin-sidebar-accent: #206bc4;
    --admin-surface: #ffffff;
    --admin-border: #dce1e7;
    --admin-page: #f4f6f8;
}

.gift-code-table td { vertical-align: middle; }
.gift-code-reward-summary { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 180px; }
.gift-code-reward-summary span { white-space: nowrap; }
.gift-code-item-results { display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.gift-code-item-result { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--tblr-border-color, #d8dee7); border-radius: 6px; background: #fff; text-align: left; }
.gift-code-item-result:hover { border-color: #206bc4; background: #f6f9fd; }
.gift-code-item-result span { color: #667085; font-size: 12px; }

html, body {
    min-height: 100%;
}

body {
    background: var(--admin-page);
    letter-spacing: 0;
}

.admin-sidebar {
    background: var(--admin-sidebar);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.brand-mark {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 4px;
    background: #fff;
    color: var(--admin-sidebar);
}

.admin-topbar {
    min-height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--admin-border);
}

.page-body {
    padding-top: 1.25rem;
    padding-bottom: 2rem;
}

.nav-link-icon svg,
.btn svg,
.alert svg,
.icon-inline {
    width: 18px;
    height: 18px;
    stroke-width: 1.8;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border-radius: 4px;
}

.card {
    border-color: var(--admin-border);
    border-radius: 6px;
    box-shadow: none;
}

.metric {
    min-height: 120px;
}

.metric-value {
    font-size: 1.8rem;
    line-height: 1.2;
    font-weight: 700;
}

.table {
    margin-bottom: 0;
}

.table th {
    white-space: nowrap;
    font-weight: 600;
}

.table td {
    vertical-align: middle;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: .35rem;
    border-radius: 50%;
}

.status-dot.online { background: #2fb344; }
.status-dot.offline { background: #94a3b8; }

.section-heading {
    margin: 1.5rem 0 .75rem;
    font-size: 1rem;
    font-weight: 700;
}

.operation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1rem;
}

.operation-card .card-body {
    display: grid;
    gap: .75rem;
}

.auth-page {
    background: #eef2f6;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1.5rem;
}

.auth-card {
    width: min(100%, 440px);
    border-radius: 6px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.auth-brand .brand-mark {
    background: var(--admin-sidebar);
    color: #fff;
}

.code-block {
    padding: .85rem;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    background: #f8fafc;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.danger-zone {
    border-left: 3px solid #d63939;
}

.truncate-cell {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .page-body {
        padding-top: .75rem;
    }

    .table-responsive {
        border: 1px solid var(--admin-border);
        border-radius: 6px;
    }
}
.data-toolbar {
    min-height: 64px;
}

.game-data-table {
    max-height: 560px;
}

.game-data-table th {
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--tblr-bg-surface);
}

.game-data-cell {
    min-width: 8rem;
    max-width: 28rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .86rem;
}

.filter-card { border-top: 3px solid var(--tblr-primary); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.player-table .player-name { display: block; color: inherit; font-weight: 700; text-decoration: none; }
.player-table .player-name:hover { color: var(--tblr-primary); }
.tech-id, .tech-id-primary { color: var(--tblr-secondary); font-family: var(--tblr-font-monospace); font-size: .75rem; }
.tech-id { display: block; margin-top: .15rem; }
.tech-id-primary { font-size: .82rem; }
.map-name { display: block; margin-top: .15rem; color: var(--tblr-emphasis-color); font-weight: 600; }
.data-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.data-tab { padding: .42rem .7rem; border: 1px solid var(--admin-border); border-radius: 4px; color: var(--tblr-secondary); text-decoration: none; font-size: .84rem; }
.data-tab:hover, .data-tab.active { background: var(--tblr-primary-lt); border-color: var(--tblr-primary); color: var(--tblr-primary); }
.data-group-tabs { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--admin-border); }
.data-group-tab { flex: 0 0 auto; padding: .55rem .85rem; border-bottom: 2px solid transparent; color: var(--tblr-secondary); font-size: .86rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.data-group-tab:hover { color: var(--tblr-primary); }
.data-group-tab.active { border-bottom-color: var(--tblr-primary); color: var(--tblr-primary); }
.player-function-panel .card-body { display: grid; gap: 1.15rem; }
.player-function-group { min-width: 0; }
.player-function-group-title { display: flex; align-items: center; gap: .45rem; margin-bottom: .55rem; color: var(--tblr-secondary); font-size: .82rem; font-weight: 700; }
.player-function-group-title svg { width: 16px; height: 16px; }
.player-function-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .55rem; }
.player-function-button { display: grid; min-height: 76px; place-items: center; align-content: center; gap: .4rem; padding: .7rem; border: 1px solid var(--admin-border); border-radius: 6px; background: #fff; color: var(--tblr-body-color); font-weight: 600; }
.player-function-button:hover, .player-function-button:focus-visible { border-color: var(--tblr-primary); background: var(--tblr-primary-lt); color: var(--tblr-primary); outline: 0; }
.player-function-button svg { width: 22px; height: 22px; }
.player-function-button span { max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.player-data-modal-table { min-height: 260px; max-height: 62vh; }
.item-result-list { min-height: 1.25rem; max-height: 160px; overflow: auto; }
.selected-awards, .empty-state { padding: .7rem; border: 1px dashed var(--admin-border); border-radius: 4px; color: var(--tblr-secondary); background: #f8fafc; }
.modal-title { display: inline-flex; align-items: center; gap: .45rem; margin: 0; font-size: 1.05rem; }

.nav-section-label {
    padding: 1.25rem 1rem .35rem;
    color: rgba(255, 255, 255, .48);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-access-editor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.admin-access-editor h4 {
    margin: 0 0 .8rem;
    font-size: .95rem;
}

.access-group {
    padding: .8rem 0;
    border-top: 1px solid var(--admin-border);
}

.access-group-title {
    margin-bottom: .55rem;
    color: var(--tblr-secondary);
    font-size: .75rem;
    font-weight: 700;
}

.access-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem 1rem;
}

.service-log-table { max-height: 68vh; }
.service-log-table thead th { position: sticky; top: 0; z-index: 2; background: var(--tblr-bg-surface); }
.log-time { min-width: 132px; font-family: var(--tblr-font-monospace); font-size: .78rem; white-space: nowrap; }
.log-source { max-width: 240px; overflow: hidden; text-overflow: ellipsis; font-size: .78rem; white-space: nowrap; }
.log-message { min-width: 380px; max-width: 760px; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; font-family: var(--tblr-font-monospace); font-size: .78rem; line-height: 1.45; }

.performance-chart-card canvas {
    display: block;
    width: 100%;
    height: 260px;
}

.performance-legend {
    display: flex;
    min-height: 24px;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    color: var(--tblr-secondary);
    font-size: .78rem;
}

.performance-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.performance-legend i { display: inline-block; width: 14px; height: 3px; }

@media (max-width: 767px) {
    .admin-access-editor { grid-template-columns: minmax(0, 1fr); }
    .access-option-grid { grid-template-columns: minmax(0, 1fr); }
    .log-message { min-width: 300px; }
}

.config-section-tabs {
    display: flex;
    gap: .35rem;
    border-bottom: 1px solid var(--admin-border);
}

.config-section-tabs a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .7rem 1rem;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--tblr-secondary);
    text-decoration: none;
    font-weight: 600;
}

.config-section-tabs a.active,
.config-section-tabs a:hover {
    border-bottom-color: var(--tblr-primary);
    color: var(--tblr-primary);
}

.config-section-tabs svg { width: 17px; height: 17px; }

.admin-data-table tbody tr:hover { background: #f8fafc; }

.drop-pool { padding: .8rem 1rem; border-bottom: 1px solid var(--admin-border); }
.drop-pool:last-child { border-bottom: 0; }
.drop-pool-head, .drop-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.drop-pool-head { margin-bottom: .45rem; }
.drop-pool-head span, .drop-row small { color: var(--tblr-secondary); }
.drop-row { padding: .28rem 0; font-size: .86rem; }

.sticky-actionbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 64px;
    padding: .75rem 1rem;
    border: 1px solid var(--admin-border);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -6px 18px rgba(24, 36, 51, .06);
}

.metric-mini { min-height: 104px; padding: 1rem; }
.metric-mini strong { margin: .25rem 0; font-size: 1.35rem; }
.metric-mini span { color: var(--tblr-secondary); font-size: .82rem; }

.workspace-page-body {
    min-height: 0;
    overflow: hidden;
}

.workspace-container {
    display: flex;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    flex-direction: column;
}

body.workspace-shell {
    height: 100vh;
    overflow: hidden;
}

body.workspace-shell > .page,
body.workspace-shell .page-wrapper {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

body.workspace-shell .page-wrapper {
    max-height: 100vh;
}

body.workspace-shell .workspace-page-body {
    flex: 1 1 0;
}

.spawn-workbench-page {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.spawn-workbench-header {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.spawn-workbench-header .page-title { margin: 0; font-size: 1.25rem; }
.spawn-workbench-tabs { flex: 0 0 auto; margin: .45rem 0 .7rem; }

.spawn-workbench {
    display: grid;
    min-height: 0;
    flex: 1;
    grid-template-columns: 250px minmax(480px, 1fr) 390px;
    overflow: hidden;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    background: #fff;
}

.spawn-workbench-maps,
.spawn-workbench-detail,
.spawn-workbench-canvas,
.spawn-monster-pane,
.spawn-point-pane {
    min-width: 0;
    min-height: 0;
}

.spawn-workbench-maps {
    display: grid;
    grid-template-rows: 48px 48px minmax(0, 1fr);
    border-right: 1px solid var(--admin-border);
}

.spawn-pane-header,
.spawn-canvas-toolbar,
.spawn-map-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--admin-border);
}

.spawn-pane-header { min-height: 48px; }
.spawn-map-search { margin: .45rem .65rem; }
.spawn-map-list { min-height: 0; overflow: auto; padding: 0 .4rem .55rem; }

.spawn-map-group-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    padding: .7rem .45rem .3rem;
    color: var(--tblr-secondary);
    font-size: .75rem;
    font-weight: 700;
}

.spawn-map-group-title span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spawn-map-option {
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .45rem .55rem;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    color: inherit;
    text-align: left;
}

.spawn-map-option:hover { background: #f5f8fb; }
.spawn-map-option.active { border-left-color: var(--tblr-primary); background: var(--tblr-primary-lt); color: var(--tblr-primary); }
.spawn-map-option > span:first-child { min-width: 0; }
.spawn-map-option strong,
.spawn-map-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spawn-map-option strong { font-size: .86rem; }
.spawn-map-option small { margin-top: .12rem; color: var(--tblr-secondary); font-size: .7rem; }
.spawn-map-option-meta { display: flex; flex: 0 0 auto; align-items: center; gap: .35rem; font-size: .72rem; }
.spawn-map-option-meta .status-dot { margin: 0; }

.spawn-workbench-canvas {
    display: grid;
    grid-template-rows: 58px minmax(0, 1fr) 38px;
    background: #f5f7fa;
}

.spawn-canvas-toolbar { background: #fff; }
.spawn-current-map { min-width: 0; }
.spawn-current-map strong,
.spawn-current-map span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spawn-current-map span { margin-top: .15rem; color: var(--tblr-secondary); font-size: .75rem; }
.spawn-toolbar-actions { display: flex; flex: 0 0 auto; gap: .4rem; }
.spawn-toolbar-actions .btn-icon { width: 34px; height: 34px; }

.spawn-canvas-shell { position: relative; min-height: 0; overflow: hidden; background: #edf1f5; }
.spawn-canvas-shell canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.spawn-canvas-loading { position: absolute; inset: 0; display: grid; place-content: center; gap: .5rem; background: rgb(255 255 255 / 82%); color: var(--tblr-secondary); }
/* 原生 hidden 必须优先于工作台的 grid/flex 布局，避免遮罩和已过滤地图仍被强制显示。 */
.spawn-canvas-loading[hidden],
.spawn-map-option[hidden],
.spawn-map-group[hidden] { display: none; }
.spawn-map-status { min-width: 0; border-top: 1px solid var(--admin-border); border-bottom: 0; background: #fff; color: var(--tblr-secondary); font-size: .75rem; }
.spawn-map-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spawn-map-status.is-error { background: #fff1f0; border-top-color: #e03131; color: #b42318; font-weight: 600; }
.spawn-map-status.is-error span:first-child { white-space: normal; }
.spawn-map-status.is-success { background: #edf8f1; border-top-color: #2f9e44; color: #25753a; }

.spawn-workbench-detail {
    display: grid;
    grid-template-rows: minmax(190px, 38%) minmax(0, 62%);
    border-left: 1px solid var(--admin-border);
}

.spawn-monster-pane,
.spawn-point-pane { display: grid; overflow: hidden; }
.spawn-monster-pane { grid-template-rows: 48px minmax(0, 1fr); border-bottom: 1px solid var(--admin-border); }
.spawn-point-pane { grid-template-rows: 48px minmax(112px, 42%) minmax(0, 1fr); }
.spawn-unique-monsters,
.spawn-point-list,
.spawn-point-inspector { min-height: 0; overflow: auto; }
.spawn-unique-monsters { padding: .35rem .55rem; }

.spawn-monster-row,
.spawn-point-row {
    display: grid;
    width: 100%;
    align-items: center;
    gap: .55rem;
    padding: .48rem .35rem;
    border: 0;
    border-bottom: 1px solid #edf0f3;
    background: #fff;
    color: inherit;
    text-align: left;
}

.spawn-monster-row { grid-template-columns: minmax(0, 1fr) auto; }
.spawn-point-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
.spawn-monster-row:hover,
.spawn-point-row:hover { background: #f7f9fb; }
.spawn-point-row.active { background: var(--tblr-primary-lt); color: var(--tblr-primary); }
.spawn-monster-row strong,
.spawn-point-row strong,
.spawn-monster-row small,
.spawn-point-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spawn-monster-row small,
.spawn-point-row small { color: var(--tblr-secondary); font-size: .7rem; }
.spawn-monster-row .btn-icon { width: 30px; height: 30px; }
.spawn-point-coordinate { color: var(--tblr-secondary); font-size: .7rem; text-align: right; }
.spawn-point-inspector { padding: .65rem .75rem .8rem; border-top: 1px solid var(--admin-border); }
.spawn-point-inspector .form-label { margin-bottom: .2rem; font-size: .7rem; }
.spawn-point-inspector .form-control,
.spawn-point-inspector .form-select { min-height: 30px; padding: .25rem .4rem; font-size: .78rem; }
.spawn-inspector-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.spawn-inspector-title > div { min-width: 0; }
.spawn-inspector-title strong,
.spawn-inspector-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.monster-picker-results { max-height: 360px; margin-top: .75rem; overflow: auto; border-top: 1px solid var(--admin-border); }
.monster-result { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; padding: .65rem .4rem; border: 0; border-bottom: 1px solid var(--admin-border); background: #fff; text-align: left; }
.monster-result:hover { background: var(--tblr-primary-lt); color: var(--tblr-primary); }
.monster-result strong,
.monster-result small { display: block; }
.monster-result small { color: var(--tblr-secondary); }
.monster-template-editor { height: min(72vh, 760px); padding-top: 0; overflow: hidden; }
.monster-template-tabs { position: sticky; top: 0; z-index: 3; gap: .25rem; padding-top: 1rem; background: var(--tblr-bg-surface); }
.monster-template-tabs .nav-link { display: inline-flex; align-items: center; gap: .4rem; }
.monster-template-tabs .nav-link svg { width: 17px; height: 17px; }
.monster-template-tab-content { height: calc(100% - 57px); overflow: hidden; }
.monster-template-tab-content > .tab-pane { height: 100%; padding: 1rem .15rem .25rem; overflow: auto; }
.monster-template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.monster-template-grid > label { min-width: 0; font-size: .75rem; font-weight: 600; }
.monster-template-grid .form-control { margin-top: .25rem; }
.monster-template-grid .form-check { align-self: end; min-height: 38px; align-items: center; }
.monster-skill-primary-grid,
.monster-experience-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.monster-experience-grid { max-width: 760px; }
.monster-experience-grid > label { font-size: .8rem; font-weight: 600; }
.monster-experience-grid .form-control { margin-top: .35rem; }
.monster-editor-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.1rem 0 .65rem; }
.monster-editor-section-head strong,
.monster-editor-section-head small { display: block; }
.monster-editor-section-head small { margin-top: .15rem; color: var(--tblr-secondary); font-size: .72rem; }
.template-lookup { position: relative; }
.template-selected-value { min-height: 28px; padding: .35rem .15rem 0; color: var(--tblr-secondary); font-size: .78rem; }
.template-lookup-results { position: absolute; z-index: 8; top: calc(100% + .25rem); right: 0; left: 0; max-height: 250px; overflow: auto; border: 1px solid var(--admin-border); border-radius: 6px; background: #fff; box-shadow: 0 12px 28px rgb(15 23 42 / 15%); }
.template-lookup-result { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .7rem; border: 0; border-bottom: 1px solid var(--admin-border); background: #fff; text-align: left; }
.template-lookup-result:hover { background: var(--tblr-primary-lt); color: var(--tblr-primary); }
.template-lookup-result small { color: var(--tblr-secondary); }
.twisted-egg-item-cell { display: grid; gap: .35rem; min-width: 220px; }
.twisted-egg-item-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.twisted-egg-item-cell small { color: var(--tblr-secondary); font-size: .72rem; }
.pity-target-list { display: flex; flex-wrap: wrap; gap: .35rem .8rem; min-height: 38px; padding: .45rem .6rem; border: 1px solid var(--admin-border); border-radius: 6px; background: #f8fafc; }
.pity-target-option { margin: 0; }
.twisted-egg-item-results { display: grid; max-height: 360px; overflow: auto; border: 1px solid var(--admin-border); border-radius: 6px; }
.twisted-egg-item-result { display: flex; justify-content: space-between; gap: .75rem; padding: .65rem .75rem; border: 0; border-bottom: 1px solid var(--admin-border); background: #fff; text-align: left; }
.twisted-egg-item-result:hover { background: var(--tblr-primary-lt); color: var(--tblr-primary); }
.twisted-egg-item-result strong, .twisted-egg-item-result small { display: block; }
.twisted-egg-item-result small { color: var(--tblr-secondary); font-size: .74rem; }
.active-skill-lookup { max-width: 620px; }
.monster-active-skills { display: grid; gap: .45rem; margin-top: .75rem; }
.monster-active-skill { display: grid; grid-template-columns: minmax(0, 1fr) 180px 36px; align-items: center; gap: .6rem; padding: .55rem .65rem; border: 1px solid var(--admin-border); border-radius: 6px; background: #fff; }
.monster-active-skill strong,
.monster-active-skill small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monster-active-skill small { color: var(--tblr-secondary); font-size: .7rem; }
.monster-drop-pools { display: grid; gap: .75rem; }
.monster-drop-pool { border: 1px solid var(--admin-border); border-radius: 6px; background: #fff; }
.monster-drop-pool-head { display: grid; grid-template-columns: minmax(170px, 1fr) 150px 130px auto 36px; align-items: end; gap: .65rem; padding: .7rem; border-bottom: 1px solid var(--admin-border); background: #f8fafc; }
.monster-drop-pool-head label { margin: 0; color: var(--tblr-secondary); font-size: .7rem; }
.monster-drop-pool-head .form-control { margin-top: .2rem; }
.monster-drop-pool-items { padding: .2rem .7rem .7rem; }
.monster-drop-item { position: relative; display: grid; grid-template-columns: minmax(240px, 1fr) 120px 120px 36px; align-items: end; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--admin-border); }
.monster-drop-item:last-child { border-bottom: 0; }
.monster-drop-item label { margin: 0; color: var(--tblr-secondary); font-size: .7rem; }
.monster-drop-item .form-control { margin-top: .2rem; }
.monster-drop-item .template-lookup-results { top: calc(100% - 2px); }
.monster-drop-empty { padding: 1.2rem; color: var(--tblr-secondary); text-align: center; }
.spawn-workbench-empty { flex: 1; display: grid; place-content: center; border: 1px solid var(--admin-border); background: #fff; }

.equipment-config-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--admin-border);
    background: #f8fafc;
}
.equipment-config-summary strong, .equipment-config-summary span { display: block; }
.equipment-config-summary > div > span { color: var(--tblr-secondary); font-size: .82rem; }
.equipment-base-attrs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.equipment-base-attrs span { padding: .2rem .45rem; border: 1px solid #b6d4fe; background: #e7f1ff; color: #1d4f91; font-size: .76rem; }
.equipment-config-section { padding: 1rem 0; border-bottom: 1px solid var(--admin-border); }
.equipment-config-section:last-child { border-bottom: 0; }
.equipment-config-section h4 { margin: 0 0 .75rem; font-size: .95rem; }

.activity-boss-editor { --activity-accent: #206bc4; --activity-soft: #f5f8fc; }
.activity-boss-summary { display: flex; align-items: center; gap: 1rem; }
.activity-boss-list { display: grid; gap: 1.25rem; }
.activity-boss-card { overflow: visible; border-color: #d9e1eb; box-shadow: 0 8px 24px rgb(31 41 55 / 5%); }
.activity-boss-card .card-header { min-height: 76px; }
.activity-boss-card-header { padding: 1rem 1.15rem; border-bottom-color: #dce4ed; background: linear-gradient(135deg, #fff 0%, #f7fafe 100%); }
.activity-boss-card-title { display: flex; min-width: 0; align-items: center; gap: .85rem; }
.activity-boss-card-title > div { min-width: 0; }
.activity-boss-card-title h3,
.activity-boss-card-title .text-secondary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-boss-order { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 10px; background: var(--activity-accent); color: #fff; font-weight: 700; box-shadow: 0 5px 12px rgb(32 107 196 / 24%); }
.activity-boss-editor-sections { display: grid; gap: 1rem; padding: 1.15rem; background: #eef3f8; }
.activity-boss-section { min-width: 0; padding: 1rem; border: 1px solid #dbe3ed; border-radius: 9px; background: #fff; }
.activity-boss-section-title { display: flex; align-items: center; gap: .65rem; margin-bottom: .9rem; padding-bottom: .75rem; border-bottom: 1px solid #e8edf3; }
.activity-boss-section-title > svg { width: 20px; height: 20px; color: var(--activity-accent); }
.activity-boss-section-title strong,
.activity-boss-section-title small { display: block; }
.activity-boss-section-title strong { color: #1e293b; font-size: .9rem; }
.activity-boss-section-title small { margin-top: .1rem; color: var(--tblr-secondary); font-size: .72rem; }
.activity-boss-grid { display: grid; gap: .85rem; align-items: end; }
.activity-boss-grid-identity { grid-template-columns: minmax(160px, .65fr) minmax(300px, 1.5fr) minmax(150px, .6fr); }
.activity-boss-grid-location { grid-template-columns: minmax(300px, 1.2fr) minmax(220px, 1fr) minmax(320px, 1.2fr) minmax(170px, .6fr); }
.activity-boss-grid-runtime { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
.activity-boss-grid > label,
.activity-boss-lines { min-width: 0; margin: 0; color: #334155; font-size: .75rem; font-weight: 650; }
.activity-boss-grid .form-control,
.activity-boss-grid .form-select,
.activity-boss-schedule-layout .form-control,
.activity-boss-schedule-layout .form-select { margin-top: .25rem; }
.activity-boss-help { display: block; min-height: 1.15rem; margin-top: .12rem; color: #7a8899; font-size: .67rem; font-weight: 400; }
.activity-boss-wide { grid-column: 1 / -1; }
.activity-boss-lookup { position: relative; }
.activity-boss-results { position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; left: 0; max-height: 260px; overflow: auto; border: 1px solid var(--admin-border); border-radius: 6px; background: #fff; box-shadow: 0 12px 28px rgb(15 23 42 / 15%); }
.activity-boss-result { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .7rem; border: 0; border-bottom: 1px solid var(--admin-border); background: #fff; text-align: left; }
.activity-boss-result:hover { background: var(--tblr-primary-lt); color: var(--tblr-primary); }
.activity-boss-result small { color: var(--tblr-secondary); }
.activity-boss-coordinate-field { min-width: 0; }
.activity-boss-coordinate-field .form-label { margin: 0; color: #334155; font-size: .75rem; font-weight: 650; }
.activity-boss-map-action { display: flex; min-width: 0; align-items: center; gap: .7rem; }
.activity-boss-map-action small { overflow: hidden; color: var(--tblr-secondary); text-overflow: ellipsis; white-space: nowrap; }
.activity-boss-lines { grid-column: 1 / -1; padding-top: .2rem; }
.activity-boss-line-list { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .35rem; padding: .65rem .75rem; border: 1px solid #e1e7ef; border-radius: 6px; background: var(--activity-soft); }
.activity-boss-line-option { margin: 0; }
.activity-boss-schedule-layout { display: grid; grid-template-columns: minmax(240px, .65fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.activity-boss-schedule-layout > label { margin: 0; color: #334155; font-size: .75rem; font-weight: 650; }
.activity-boss-schedule-fields { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: .75rem; padding: .8rem; border: 1px solid #dfe7f0; border-radius: 7px; background: var(--activity-soft); }
.activity-boss-schedule-fields[hidden] { display: none !important; }
.activity-boss-schedule-fields > label { margin: 0; color: #334155; font-size: .75rem; font-weight: 650; }
.activity-boss-schedule-preview { display: flex; grid-column: 1 / -1; align-items: center; gap: .55rem; padding: .55rem .65rem; border-radius: 5px; background: #e8f1fc; color: #31577f; font-size: .74rem; }
.activity-boss-daily-schedule { display: block; }
.activity-boss-daily-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.activity-boss-daily-head strong,
.activity-boss-daily-head small { display: block; }
.activity-boss-daily-head small { color: var(--tblr-secondary); font-size: .68rem; }
.activity-boss-time-list { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: .6rem; margin-top: .75rem; }
.activity-boss-time-row { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: .4rem; }
.activity-boss-map-body { display: grid; gap: .75rem; padding: 1rem; background: #eef3f8; }
.activity-boss-map-toolbar { display: flex; align-items: center; gap: .75rem; min-height: 38px; padding: .45rem .65rem; border: 1px solid #dce4ed; border-radius: 6px; background: #fff; color: #526273; font-size: .78rem; }
.activity-boss-map-canvas-shell { position: relative; height: min(64vh, 680px); min-height: 430px; overflow: hidden; border: 1px solid #b9c6d5; border-radius: 8px; background: #e8edf3; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 55%); }
.activity-boss-map-canvas-shell canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.activity-boss-map-loading { position: absolute; inset: 0; display: grid; place-content: center; gap: .5rem; background: rgb(247 250 252 / 84%); color: #34495e; font-weight: 600; }
.activity-boss-map-loading[hidden] { display: none !important; }

@media (max-width: 767px) {
    .table-toolbar { align-items: flex-start; flex-direction: column; }
    .config-section-tabs { overflow-x: auto; }
    .config-section-tabs a { white-space: nowrap; }
    .monster-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .monster-drop-pool-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .monster-drop-item { grid-template-columns: minmax(200px, 1fr) 100px 100px 36px; }
}

@media (max-width: 1199px) {
    body.workspace-shell { height: auto; overflow: visible; }
    body.workspace-shell > .page,
    body.workspace-shell .page-wrapper { height: auto; max-height: none; overflow: visible; }
    .workspace-page-body { height: auto; overflow: visible; }
    .workspace-container { height: auto; }
    .spawn-workbench-page { display: block; }
    .spawn-workbench { grid-template-columns: 230px minmax(500px, 1fr); overflow: visible; }
    .spawn-workbench-maps { height: 680px; }
    .spawn-workbench-canvas { height: 680px; }
    .spawn-workbench-detail { grid-column: 1 / -1; height: 680px; border-top: 1px solid var(--admin-border); border-left: 0; }
}

@media (max-width: 767px) {
    .spawn-workbench { display: block; }
    .spawn-workbench-maps,
    .spawn-workbench-canvas,
    .spawn-workbench-detail { height: 620px; border: 0; border-bottom: 1px solid var(--admin-border); }
    .monster-skill-primary-grid,
    .monster-experience-grid { grid-template-columns: 1fr; }
    .monster-drop-item { grid-template-columns: 1fr 1fr; }
    .monster-drop-item > :first-child { grid-column: 1 / -1; }
    .activity-boss-summary { align-items: flex-start; flex-direction: column; }
    .activity-boss-card-header { align-items: flex-start; flex-direction: column; }
    .activity-boss-card-header > .ms-auto { width: 100%; margin-left: 0 !important; flex-wrap: wrap; }
    .activity-boss-grid,
    .activity-boss-grid-identity,
    .activity-boss-grid-location,
    .activity-boss-grid-runtime,
    .activity-boss-schedule-layout,
    .activity-boss-schedule-fields { grid-template-columns: 1fr; }
    .activity-boss-time-list { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .activity-boss-map-action { align-items: flex-start; flex-direction: column; }
    .activity-boss-map-canvas-shell { min-height: 360px; }
    .activity-boss-wide { grid-column: auto; }
}
