/* position_definition — 岗位定义设置页（基于 system_component_form 壳层） */

@import url("/assets/plugins/system_component_form/css/index.css");

.pdef-settings-page {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.pdef-page-header {
    flex: 0 0 auto;
}

.pdef-page-header__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #7c3aed;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(91, 33, 182, 0.1));
    flex-shrink: 0;
}

.pdef-scope-alert {
    flex-shrink: 0;
    border: 1px solid rgba(124, 58, 237, 0.16);
}

.pdef-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: var(--radius-md, 12px);
    background: var(--panel);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.pdef-panel-head {
    flex-shrink: 0;
}

.pdef-panel-head-inner {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.04), transparent);
}

.pdef-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.pdef-panel-title i {
    color: #7c3aed;
}

.pdef-panel-table-slot {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.pdef-table-wrap,
.pdef-grid-host {
    flex: 1 1 auto;
    min-height: 208px;
    display: flex;
    flex-direction: column;
}

.pdef-ag-grid-fill {
    height: 100%;
    width: 100%;
}

.ag-theme-ceramic.ag-pdef-gridwrap {
    --ag-row-height: 52px;
    --ag-header-height: 52px;
    --ag-selected-row-background-color: rgba(124, 58, 237, 0.06);
    --sigen-action-col-width: 128px;
}

.ag-theme-ceramic.ag-pdef-gridwrap .ag-header {
    background: linear-gradient(180deg, var(--bg0) 0%, rgba(248, 250, 252, 0.92) 100%);
}

.ag-theme-ceramic.ag-pdef-gridwrap .ag-cell {
    border-right: none !important;
}

.pdef-action-container {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
}

.pdef-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.pdef-action-btn:hover {
    background: rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.pdef-action-btn--edit {
    color: #fd7e14;
}

.pdef-action-btn--delete {
    color: #fa5252;
}

/* 列表启用状态药丸 */
.sys-form-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}

.sys-form-status-pill__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sys-form-status-pill--on {
    color: #15803d;
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0.06));
    border-color: rgba(34, 197, 94, 0.22);
}

.sys-form-status-pill--on .sys-form-status-pill__dot {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.sys-form-status-pill--off {
    color: #64748b;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.16), rgba(148, 163, 184, 0.08));
    border-color: rgba(148, 163, 184, 0.22);
}

.sys-form-status-pill--off .sys-form-status-pill__dot {
    background: #94a3b8;
}

.pdef-grid-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 16px;
    color: var(--muted);
}

.pdef-grid-empty-icon {
    font-size: 36px;
    opacity: 0.28;
    color: #7c3aed;
}

/* 编辑弹窗 — 套用 sys-form 并覆写 violet 主题 */
.pdef-edit-modal .sys-form-modal-title__icon {
    color: #7c3aed;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(91, 33, 182, 0.12));
}

.pdef-edit-modal .sys-form-section {
    border-color: rgba(124, 58, 237, 0.12) !important;
    background: rgba(255, 255, 255, 0.82);
}

.pdef-edit-modal .sys-form-section__head {
    color: #6d28d9;
}

.pdef-edit-modal-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px 16px !important;
}

.pdef-edit-modal-content {
    width: min(92vw, 960px) !important;
    max-width: 960px !important;
    max-height: min(88vh, 900px) !important;
    margin: 0 !important;
    border: 1px solid rgba(124, 58, 237, 0.1);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
}

.pdef-edit-modal-body {
    overflow: hidden;
}

.pdef-edit-form-shell {
    display: flex;
    flex-direction: column;
    max-height: calc(min(88vh, 900px) - 72px);
    min-height: 0;
}

.pdef-edit-form-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(62vh, 640px);
    overflow: auto;
    padding-right: 4px;
}

.pdef-edit-form-scroll > .sys-form-section + .sys-form-section {
    margin-top: 12px;
}

.pdef-edit-form-footer {
    flex: 0 0 auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

/* 表单内启用状态 SegmentedControl 药丸 */
.sys-form-enabled-pill {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sys-form-enabled-pill__label {
    color: var(--text);
}

.pdef-enabled-segment {
    max-width: 240px;
}

.pdef-enabled-segment .mantine-SegmentedControl-root {
    background: rgba(148, 163, 184, 0.12);
    padding: 3px;
    border-radius: 999px;
    border: 1px solid rgba(124, 58, 237, 0.1);
}

.pdef-enabled-segment .mantine-SegmentedControl-label {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
}

.pdef-cap-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px 12px;
    margin-top: 4px;
}

.pdef-cap-checklist__label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(124, 58, 237, 0.08);
    background: rgba(124, 58, 237, 0.02);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.pdef-cap-checklist__label:hover {
    border-color: rgba(124, 58, 237, 0.18);
    background: rgba(124, 58, 237, 0.05);
}

.pdef-cap-checklist__input {
    margin-top: 2px;
    accent-color: #7c3aed;
}
