/* OneHealth common compact workspace helpers
   Page-specific css should keep only domain-specific colors/details. */
.oh-workspace-root {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.oh-page-filter-strip {
    display: grid;
    align-items: end;
    gap: 8px;
    flex: 0 0 auto;
    border: 1px solid #cfe0f6;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(9, 70, 96, 0.05);
}

.oh-page-three-pane {
    display: grid;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.oh-pane-scroll {
    min-height: 0;
    overflow: auto;
}

.oh-fixed-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* hotfix_020: shared action button system and clearer search/select fields.
   Keep public navigation actions light, but make admin and modal actions unmistakable. */
:root {
    --oh-action-primary: #0a2a62;
    --oh-action-primary-hover: #06183f;
    --oh-action-secondary: #334155;
    --oh-action-secondary-hover: #1e293b;
    --oh-action-create: #0f766e;
    --oh-action-create-hover: #115e59;
    --oh-action-edit: #1d4ed8;
    --oh-action-edit-hover: #1e40af;
    --oh-action-danger: #dc2626;
    --oh-action-danger-hover: #991b1b;
    --oh-field-search-bg: #ffffff;
    --oh-field-select-bg: #f8fbff;
    --oh-field-search-border: #7dd3fc;
    --oh-field-select-border: #bfdbfe;
}

.oh-action-primary,
.oh-modal-actions .oh-action-primary,
.oh-modal-actions .btn-primary,
.oh-modal-actions button.btn-primary,
.bat-editor-actions .oh-action-primary,
.bat-editor-actions .bat-btn-primary,
.bat-btn.bat-btn-primary,
.btn.btn-primary.oh-action-primary {
    background: var(--oh-action-primary) !important;
    border: 1px solid var(--oh-action-primary-hover) !important;
    color: #ffffff !important;
    font-weight: 950 !important;
    box-shadow: 0 10px 22px rgba(10, 42, 98, .22) !important;
}

.oh-action-primary:hover:not(:disabled),
.oh-modal-actions .oh-action-primary:hover:not(:disabled),
.oh-modal-actions .btn-primary:hover:not(:disabled),
.bat-editor-actions .oh-action-primary:hover:not(:disabled),
.bat-editor-actions .bat-btn-primary:hover:not(:disabled),
.bat-btn.bat-btn-primary:hover:not(:disabled),
.btn.btn-primary.oh-action-primary:hover:not(:disabled) {
    background: var(--oh-action-primary-hover) !important;
    border-color: var(--oh-action-primary-hover) !important;
    color: #ffffff !important;
}

.oh-action-secondary,
.oh-modal-close,
.oh-modal-actions .oh-action-secondary,
.oh-modal-actions .btn-outline-secondary,
.oh-modal-actions .btn-secondary,
.oh-modal-actions button.btn-outline-secondary,
.bat-editor-actions .oh-action-secondary,
.bat-editor-actions .bat-btn-secondary,
.bat-editor-actions .bat-btn-ghost,
.btn.btn-outline-secondary.oh-action-secondary {
    background: var(--oh-action-secondary) !important;
    border: 1px solid var(--oh-action-secondary-hover) !important;
    color: #ffffff !important;
    font-weight: 950 !important;
    box-shadow: 0 9px 18px rgba(15, 23, 42, .18) !important;
}

.oh-action-secondary:hover:not(:disabled),
.oh-modal-close:hover:not(:disabled),
.oh-modal-actions .oh-action-secondary:hover:not(:disabled),
.oh-modal-actions .btn-outline-secondary:hover:not(:disabled),
.bat-editor-actions .oh-action-secondary:hover:not(:disabled),
.bat-editor-actions .bat-btn-secondary:hover:not(:disabled),
.bat-editor-actions .bat-btn-ghost:hover:not(:disabled),
.btn.btn-outline-secondary.oh-action-secondary:hover:not(:disabled) {
    background: var(--oh-action-secondary-hover) !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
}

.oh-action-danger,
.oh-admin-action-delete,
.oh-modal-actions .btn-danger,
.bat-btn-danger,
.bat-mini-btn.danger,
.bat-row-action.danger,
.btn.btn-danger {
    background: var(--oh-action-danger) !important;
    border: 1px solid var(--oh-action-danger-hover) !important;
    color: #ffffff !important;
    font-weight: 950 !important;
    box-shadow: 0 9px 18px rgba(220, 38, 38, .18) !important;
}

.oh-action-danger:hover:not(:disabled),
.oh-admin-action-delete:hover:not(:disabled),
.oh-modal-actions .btn-danger:hover:not(:disabled),
.bat-btn-danger:hover:not(:disabled),
.bat-mini-btn.danger:hover:not(:disabled),
.bat-row-action.danger:hover:not(:disabled),
.btn.btn-danger:hover:not(:disabled) {
    background: var(--oh-action-danger-hover) !important;
    border-color: var(--oh-action-danger-hover) !important;
    color: #ffffff !important;
}

.oh-admin-action-create {
    background: var(--oh-action-create) !important;
    border: 1px solid var(--oh-action-create-hover) !important;
    color: #ffffff !important;
    font-weight: 950 !important;
    box-shadow: 0 8px 16px rgba(15, 118, 110, .16) !important;
}

.oh-admin-action-create:hover:not(:disabled) {
    background: var(--oh-action-create-hover) !important;
    border-color: var(--oh-action-create-hover) !important;
    color: #ffffff !important;
}

.oh-admin-action-edit {
    background: var(--oh-action-edit) !important;
    border: 1px solid var(--oh-action-edit-hover) !important;
    color: #ffffff !important;
    font-weight: 950 !important;
    box-shadow: 0 8px 16px rgba(29, 78, 216, .16) !important;
}

.oh-admin-action-edit:hover:not(:disabled) {
    background: var(--oh-action-edit-hover) !important;
    border-color: var(--oh-action-edit-hover) !important;
    color: #ffffff !important;
}

.oh-user-action,
.btn.btn-outline-primary.oh-user-action,
.bat-row-action:not(.oh-admin-action):not(.danger) {
    background: #ffffff !important;
    border: 1px solid #bfdbfe !important;
    color: #0a2a62 !important;
    font-weight: 900 !important;
    box-shadow: none !important;
}

.oh-user-action:hover:not(:disabled),
.btn.btn-outline-primary.oh-user-action:hover:not(:disabled),
.bat-row-action:not(.oh-admin-action):not(.danger):hover:not(:disabled) {
    background: #eff6ff !important;
    border-color: #60a5fa !important;
    color: #06183f !important;
}

.oh-admin-action:disabled,
.oh-action-primary:disabled,
.oh-action-secondary:disabled,
.oh-action-danger:disabled,
.bat-btn:disabled,
.bat-mini-btn:disabled,
.bat-row-action:disabled,
.btn:disabled {
    opacity: .48 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.oh-field {
    position: relative;
}

.oh-field input,
.oh-field select,
.bat-center-search-panel input,
.bat-center-search-panel select,
.bat-editor-form input,
.bat-editor-form select,
.bat-editor-form textarea {
    border-width: 1.5px !important;
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.oh-field-search input,
.bat-center-search-panel .oh-field-search input,
.oh-field:not(.oh-field-select) > input {
    padding-left: 34px !important;
    border-color: var(--oh-field-search-border) !important;
    background: var(--oh-field-search-bg) !important;
}

.oh-field-search::after,
.bat-center-search-panel .oh-field-search::after {
    content: "검색";
    position: absolute;
    left: 9px;
    bottom: 9px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 16px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 9px;
    font-weight: 950;
    pointer-events: none;
}

.oh-field-select select,
.bat-center-search-panel .oh-field-select select,
.oh-field > select {
    padding-right: 34px !important;
    border-color: var(--oh-field-select-border) !important;
    background-color: var(--oh-field-select-bg) !important;
    box-shadow: inset 3px 0 0 #93c5fd !important;
}

.oh-field-select::after,
.bat-center-search-panel .oh-field-select::after {
    content: "선택";
    position: absolute;
    right: 9px;
    bottom: 9px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 16px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 9px;
    font-weight: 950;
    pointer-events: none;
}

.oh-field input:focus,
.oh-field select:focus,
.bat-center-search-panel input:focus,
.bat-center-search-panel select:focus,
.bat-editor-form input:focus,
.bat-editor-form select:focus,
.bat-editor-form textarea:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .16) !important;
}

.oh-field label,
.oh-field > span,
.bat-center-search-panel .oh-field > span {
    color: #0a2a62 !important;
    font-weight: 950 !important;
}

/* hotfix_021: compact filter strip restoration.
   Keep filters in one row when possible and at most two rows on normal desktop widths.
   Search/select distinction is kept subtle without pill badges that inflate height. */
.oh-page-filter-strip,
.bat-center-search-panel.oh-page-filter-strip,
.ac-filter-grid.oh-page-filter-strip,
.pa-filter-grid.oh-page-filter-strip {
    display: grid !important;
    grid-template-columns: minmax(260px, 1.65fr) repeat(4, minmax(130px, .9fr)) auto !important;
    gap: 8px !important;
    align-items: end !important;
    padding: 10px 12px !important;
    min-height: 0 !important;
}

.oh-page-filter-strip > .wide,
.bat-center-search-panel.oh-page-filter-strip > .wide {
    grid-column: auto !important;
}

.oh-page-filter-strip .oh-field,
.bat-center-search-panel.oh-page-filter-strip .oh-field {
    min-width: 0 !important;
    display: grid !important;
    gap: 4px !important;
}

.oh-page-filter-strip .oh-field > span,
.bat-center-search-panel.oh-page-filter-strip .oh-field > span {
    font-size: 11px !important;
    line-height: 1.15 !important;
    color: #0a2a62 !important;
    font-weight: 900 !important;
}

.oh-page-filter-strip input,
.oh-page-filter-strip select,
.bat-center-search-panel.oh-page-filter-strip input,
.bat-center-search-panel.oh-page-filter-strip select {
    height: 34px !important;
    min-height: 34px !important;
    width: 100% !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    font-weight: 750 !important;
}

.oh-page-filter-strip .oh-field-search input,
.bat-center-search-panel.oh-page-filter-strip .oh-field-search input,
.oh-field-search input {
    padding-left: 12px !important;
    border: 1px solid #8ec5ff !important;
    background: #ffffff !important;
    box-shadow: inset 3px 0 0 #38bdf8 !important;
}

.oh-page-filter-strip .oh-field-select select,
.bat-center-search-panel.oh-page-filter-strip .oh-field-select select,
.oh-field-select select {
    padding-left: 12px !important;
    padding-right: 28px !important;
    border: 1px solid #c7d7ee !important;
    background-color: #f8fbff !important;
    box-shadow: inset 3px 0 0 #cbd5e1 !important;
}

.oh-page-filter-strip .oh-field-search::after,
.oh-page-filter-strip .oh-field-select::after,
.bat-center-search-panel.oh-page-filter-strip .oh-field-search::after,
.bat-center-search-panel.oh-page-filter-strip .oh-field-select::after,
.oh-field-search::after,
.oh-field-select::after {
    content: none !important;
    display: none !important;
}

.oh-page-filter-strip .bat-center-search-actions,
.bat-center-search-panel.oh-page-filter-strip .bat-center-search-actions,
.oh-page-filter-strip .filter-actions,
.oh-page-filter-strip .ac-filter-actions,
.oh-page-filter-strip .pa-filter-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: end !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    white-space: nowrap !important;
    grid-column: auto !important;
}

.oh-page-filter-strip .bat-center-search-actions .bat-btn,
.bat-center-search-panel.oh-page-filter-strip .bat-center-search-actions .bat-btn {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 14px !important;
}

@media (max-width: 1500px) {
    .oh-page-filter-strip,
    .bat-center-search-panel.oh-page-filter-strip,
    .ac-filter-grid.oh-page-filter-strip,
    .pa-filter-grid.oh-page-filter-strip {
        grid-template-columns: minmax(220px, 1.35fr) repeat(2, minmax(140px, 1fr)) auto !important;
    }
}

@media (max-width: 900px) {
    .oh-page-filter-strip,
    .bat-center-search-panel.oh-page-filter-strip,
    .ac-filter-grid.oh-page-filter-strip,
    .pa-filter-grid.oh-page-filter-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .oh-page-filter-strip .bat-center-search-actions,
    .bat-center-search-panel.oh-page-filter-strip .bat-center-search-actions,
    .oh-page-filter-strip .filter-actions,
    .oh-page-filter-strip .ac-filter-actions,
    .oh-page-filter-strip .pa-filter-actions {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 640px) {
    .oh-page-filter-strip,
    .bat-center-search-panel.oh-page-filter-strip,
    .ac-filter-grid.oh-page-filter-strip,
    .pa-filter-grid.oh-page-filter-strip {
        grid-template-columns: 1fr !important;
    }
}

/* hotfix_022: compact demo filter/action baseline shared by ecology, alpha-corona, pathogen, acoustic and map pages. */
.oh-page-filter-strip,
.bat-center-search-panel.oh-page-filter-strip,
.ac-filter-grid.oh-page-filter-strip,
.pa-filter-grid.oh-page-filter-strip {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    gap: 8px !important;
    padding: 10px 12px !important;
}

.oh-page-filter-strip .oh-field,
.bat-center-search-panel.oh-page-filter-strip .oh-field,
.ac-filter-grid.oh-page-filter-strip .oh-field,
.pa-filter-grid.oh-page-filter-strip .oh-field {
    flex: 1 1 150px !important;
    min-width: 140px !important;
    max-width: 100% !important;
    display: grid !important;
    gap: 4px !important;
}

.oh-page-filter-strip .oh-field.wide,
.oh-page-filter-strip .wide.oh-field,
.bat-center-search-panel.oh-page-filter-strip .wide.oh-field {
    flex: 1.65 1 280px !important;
    min-width: 260px !important;
}

.oh-page-filter-strip .bat-center-search-actions,
.bat-center-search-panel.oh-page-filter-strip .bat-center-search-actions,
.oh-page-filter-strip .filter-actions,
.oh-page-filter-strip .ac-filter-actions,
.oh-page-filter-strip .pa-filter-actions {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    margin-left: auto !important;
}

.oh-page-filter-strip input,
.oh-page-filter-strip select,
.bat-center-search-panel.oh-page-filter-strip input,
.bat-center-search-panel.oh-page-filter-strip select,
.ac-filter-grid.oh-page-filter-strip input,
.ac-filter-grid.oh-page-filter-strip select,
.pa-filter-grid.oh-page-filter-strip input,
.pa-filter-grid.oh-page-filter-strip select {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    font-weight: 750 !important;
}

.oh-page-filter-strip .oh-field-search input,
.bat-center-search-panel.oh-page-filter-strip .oh-field-search input,
.oh-field-search input {
    border: 1px solid #8ec5ff !important;
    background: #fff !important;
    box-shadow: inset 3px 0 0 #38bdf8 !important;
}

.oh-page-filter-strip .oh-field-select select,
.bat-center-search-panel.oh-page-filter-strip .oh-field-select select,
.oh-field-select select {
    border: 1px solid #c7d7ee !important;
    background-color: #f8fbff !important;
    box-shadow: inset 3px 0 0 #94a3b8 !important;
}

.oh-page-filter-strip .oh-field-search::after,
.oh-page-filter-strip .oh-field-select::after,
.bat-center-search-panel.oh-page-filter-strip .oh-field-search::after,
.bat-center-search-panel.oh-page-filter-strip .oh-field-select::after,
.oh-field-search::after,
.oh-field-select::after {
    content: none !important;
    display: none !important;
}

/* clear administrative action colors: user navigation remains outline/white, admin mutation actions are filled. */
.oh-action-primary,
.bat-btn-primary,
.btn.btn-primary {
    background: #0b2f6b !important;
    border: 1px solid #0b2f6b !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(11, 47, 107, .18) !important;
}

.oh-action-secondary,
.bat-btn-secondary,
.btn.btn-secondary,
.btn.btn-outline-secondary.oh-action-secondary {
    background: #334155 !important;
    border: 1px solid #334155 !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(51, 65, 85, .16) !important;
}

.oh-action-danger,
.bat-btn-danger,
.btn.btn-danger,
.bat-row-action.danger {
    background: #dc2626 !important;
    border: 1px solid #dc2626 !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(220, 38, 38, .18) !important;
}

.oh-admin-action-create {
    background: #0f766e !important;
    border: 1px solid #0f766e !important;
    color: #fff !important;
}

.oh-admin-action-edit {
    background: #1d4ed8 !important;
    border: 1px solid #1d4ed8 !important;
    color: #fff !important;
}

.oh-admin-action-delete {
    background: #dc2626 !important;
    border: 1px solid #dc2626 !important;
    color: #fff !important;
}

.oh-user-action,
.btn.btn-outline-primary.oh-user-action,
.btn.btn-outline-secondary.oh-user-action {
    background: #fff !important;
    border: 1px solid #bfdbfe !important;
    color: #0b2f6b !important;
    box-shadow: none !important;
}

/* quick demo compacting for pages that still use the older vertical card layout. */
.oh-page-header {
    margin-bottom: 8px !important;
}

.oh-grid.oh-mb,
.oh-grid {
    gap: 10px !important;
}

.oh-card.oh-mb {
    margin-bottom: 10px !important;
}

.oh-form-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    gap: 8px !important;
}

.oh-form-grid > .oh-field,
.oh-form-grid > .oh-field-full,
.oh-form-grid > div {
    flex: 1 1 180px !important;
    min-width: 160px !important;
}

.oh-form-grid > .oh-actions-end,
.oh-form-grid > .oh-actions,
.oh-form-grid > .oh-field.oh-actions-end {
    flex: 0 0 auto !important;
    margin-left: auto !important;
}

@media (max-width: 1360px) {
    .oh-page-filter-strip .oh-field,
    .bat-center-search-panel.oh-page-filter-strip .oh-field,
    .ac-filter-grid.oh-page-filter-strip .oh-field,
    .pa-filter-grid.oh-page-filter-strip .oh-field {
        flex-basis: 190px !important;
    }
}
