.custom-select-container {
    position: relative;
    width: 100%;
    user-select: none;
    font-family: inherit;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 40px;
    padding: 0 16px;
    background-color: #ffffff;
    border-color: rgb(15 23 42 / var(--tw-border-opacity, 1));
    border-width: 1px;
    border-style: solid;
    /*border: 1px solid #cbd5e1;*/
    border-radius: 2px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-select-trigger .trigger-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
    text-align: left;
}

.custom-select-container.active .custom-select-trigger {
    border-color: #1e293b;
}

.custom-select-container.is-invalid .custom-select-trigger,
input.is-invalid,
textarea.is-invalid,
select.is-invalid {
    border-color: #ef4444 !important;
    background-color: #fff1f2 !important;
}

.custom-select-trigger .material-symbols-outlined {
    font-size: 18px;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.custom-select-container.active .custom-select-trigger .material-symbols-outlined {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-height: 240px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow-y: auto;
    z-index: 1000;
    display: none;
    animation: selectFadeIn 0.2s ease;
}

@keyframes selectFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select-container.active .custom-select-options {
    display: block;
}

.custom-select-container.disabled .custom-select-trigger {
    cursor: default;
}

.custom-select-container.drop-up .custom-select-options {
    top: auto;
    bottom: calc(100% + 4px);
    animation: selectFadeInUp 0.2s ease;
}

@keyframes selectFadeInUp {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-option {
    padding: 8px 12px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.custom-option:hover {
    background-color: #cbd5e1;
}

.custom-option.selected {
    background-color: #1e293b;
    color: #ffffff;
}

.custom-option.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    background-color: #f8fafc;
}

.custom-select-native {
    display: none !important;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 20px;
    border-radius: 2px !important;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    border: 1px solid transparent;
    box-shadow: none !important;
    user-select: none;
    text-decoration: none;
}

.btn-primary:active,
.btn-secondary:active,
.btn-success:active,
.btn-danger:active {
    transform: scale(0.98);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-success:disabled,
.btn-danger:disabled,
.btn-primary.loading,
.btn-secondary.loading,
.btn-success.loading,
.btn-danger.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.btn-primary {
    background-color: #1e293b;
    color: #ffffff;
    border-color: #1e293b;
}

.btn-primary:hover {
    background-color: #0f172a;
    border-color: #0f172a;
}

.btn-secondary {
    background-color: #ffffff;
    color: #475569;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background-color: #f8fafc;
}

.btn-success {
    background-color: #059669;
    color: #ffffff;
    border-color: #059669;
}

.btn-success:hover {
    background-color: #047857;
    border-color: #047857;
}

.btn-danger {
    background-color: #ffffff;
    color: #e11d48;
    border-color: #fda4af;
}

.btn-danger:hover {
    background-color: #fff1f2;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 2px !important;
    color: #64748b;
    background: transparent;
    border: none;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.btn-icon:hover {
    background-color: #cbd5e1;
    color: #1e293b;
}

.btn-icon:active {
    transform: scale(0.92);
}

.rounded-lg,
.rounded-md,
.rounded-xl,
.rounded-2xl,
.badge {
    border-radius: 2px !important;
}

button,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-icon {
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

::placeholder {
    color: #64748b !important;
    opacity: 1;
}

::-ms-input-placeholder {
    color: #64748b !important;
}

/* Workspace empty / waiting states */
html,
body {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

input,
textarea,
[contenteditable="true"],
.selectable {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

.erp-empty-state {
    padding: 24px;
    text-align: center;
}

.erp-empty-state__stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.erp-empty-state__icon {
    font-size: 52px !important;
    line-height: 1;
    color: #94a3b8 !important;
}

.erp-empty-state__icon-shell {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.erp-empty-state__icon-shell .erp-empty-state__icon {
    font-size: 30px !important;
    color: #94a3b8 !important;
}

.erp-empty-state__title {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    color: #64748b;
    letter-spacing: -0.01em;
}

.erp-empty-state__subtext {
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    color: #94a3b8;
}

input:not([readonly]):not([disabled]),
textarea:not([readonly]):not([disabled]) {
    color: #0f172a !important;
}

.case-register-v2-page input,
.case-register-v2-page textarea,
.case-register-v2-page select {
    user-select: text !important;
}

.badge-pale {
    border-radius: 2px !important;
    border: 1px solid #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #f8fafc;
    color: #475569;
}

/*input,*/
/*select,*/
/*textarea {*/
/*    !*border: 1px solid #cbd5e1 !important;*!*/
/*    !*border-radius: 2px !important;*!*/
/*}*/

input,
select {
    height: 40px !important;
}

input:focus,
select:focus,
textarea:focus {
    /*border-color: #1e293b !important;*/
    box-shadow: none !important;
}

#recallFab {
    position: relative;
}

#recallBadge {
    border-radius: 9999px !important;
}

.timer {
    height: 40px !important;
}

.mantine-DateTimePicker-input {
    height: 40px !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

.mini-search-bar .custom-select-trigger {
    border: 0 !important;
}

/* RHS Workspace Ascent Animation (Premium Entry Effect) */
@keyframes workspaceIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#workspaceRoot>*:not(#workspacePlaceholder):not(.hidden) {
    animation: workspaceIn 0.35s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}

/* Global typography/border standard */
body.erp-std-page h1 {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}

body.erp-std-page h2,
body.erp-std-page h4 {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}

body.erp-std-page label {
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #334155 !important;
}

body.erp-std-page input,
body.erp-std-page textarea,
body.erp-std-page select,
body.erp-std-page .custom-select-trigger {
    border-color: #cbd5e1 !important;
    border-radius: 2px !important;
}

body.erp-std-page input,
body.erp-std-page textarea,
body.erp-std-page select,
body.erp-std-page .custom-select-trigger,
body.erp-std-page .custom-select-option {
    font-size: 14px !important;
    color: #0f172a !important;
    font-weight: 400 !important;
}

body.erp-std-page .h-14,
body.erp-std-page .h-16 {
    border-color: #cbd5e1 !important;
}

/* Hardcoded dark borders fallback */
body.erp-std-page .border-slate-900 {
    border-color: #cbd5e1 !important;
}

/* Keep value text lighter than labels */
body.erp-std-page .text-slate-800.font-medium,
body.erp-std-page .text-slate-700.font-medium,
body.erp-std-page .text-slate-600.font-medium {
    font-weight: 400 !important;
}

/* LHS Active Indicator — 카테고리/폴더/트리 항목 클릭 시 좌측 3px 검정 세로줄 */
.category-item,
.folder-item,
.tree-node {
    position: relative;
}
.category-item.active::before,
.folder-item.active::before,
.tree-node.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 40px;
    background: #000;
}

/* temp-clients / clients page standardization */
body.temp-clients-page h1,
body.clients-page h1 {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}

body.temp-clients-page h2,
body.temp-clients-page h4,
body.clients-page h2,
body.clients-page h4 {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
}

body.temp-clients-page label,
body.clients-page label {
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #334155 !important;
}

body.temp-clients-page input,
body.temp-clients-page textarea,
body.temp-clients-page select,
body.temp-clients-page .custom-select-trigger,
body.temp-clients-page .custom-select-option,
body.clients-page input,
body.clients-page textarea,
body.clients-page select,
body.clients-page .custom-select-trigger,
body.clients-page .custom-select-option {
    font-size: 14px !important;
    color: #0f172a !important;
    font-weight: 400 !important;
}

body.temp-clients-page input,
body.temp-clients-page textarea,
body.temp-clients-page select,
body.temp-clients-page .custom-select-trigger,
body.clients-page input,
body.clients-page textarea,
body.clients-page select,
body.clients-page .custom-select-trigger {
    border-color: #cbd5e1 !important;
    border-radius: 2px !important;
}

body.temp-clients-page .border-slate-900,
body.clients-page .border-slate-900 {
    border-color: #cbd5e1 !important;
}

/* ─── Toggle Switch ─── */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.toggle-switch input { display: none; }
.toggle-switch .toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    background: #cbd5e1;
    border-radius: 2px;
    transition: background 0.2s ease;
}
.toggle-switch .toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.2s ease;
}
.toggle-switch input:checked + .toggle-track {
    background: #0f172a;
}
.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(16px);
}
.toggle-switch .toggle-label {
    font-size: 12px;
    color: #64748b;
}
.toggle-switch input:checked ~ .toggle-label {
    color: #0f172a;
    font-weight: 600;
}