/* bootstrap 5.2 */
.hstack {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-self: stretch;
}

.hstack-2 {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    align-self: stretch;
}

.hstack-2 .form-group {
    flex: 1;
}

.vstack {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-self: stretch;
}

.vstack-2 {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-self: unset;
}

.gap-1 {
    gap: 0.25rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

.gap-4 {
    gap: 1.5rem !important;
}

.gap-5 {
    gap: 3rem !important;
}

.vr {
    display: inline-block;
    align-self: stretch;
    width: 1px;
    min-height: 1em;
    background-color: currentcolor;
    opacity: 0.25;
}

/* Main */
.main-header,
.main-sidebar {
    z-index: 100 !important;
}

.sticky-top {
    z-index: 99;
}

.jconfirm {
    z-index: 199;
}

.control-sidebar {
    width: 400px;
}

.control-sidebar .card {
    box-shadow: unset;
}

.control-sidebar .card .card-footer {
    background-color: transparent;
}

i {
    margin: 0 0.25rem;
}

.text-title {
    border-bottom: 1px dashed;
    padding-bottom: 0.5rem;
}

/* 資料列表 */
.table-responsive .dt-processing {
    top: 0;
}

.table-responsive #datatable .highline {
    color: #ffc107;
    font-weight: bold;
}

.table-responsive #datatable thead tr th,
.table-responsive #datatable thead tr td {
    white-space: nowrap !important;
    text-align: center;
}

.table-responsive #datatable tbody tr th,
.table-responsive #datatable tbody tr td {
    vertical-align: middle !important;
}

/* select2 */
.select2-container {
    display: block;
    flex: 1;
}

.select2-container .select2-selection--single {
    height: calc(1.8125rem + 2px);
    border: 1px solid #ced4da;
}

.select2-container .select2-selection--multiple {
    border: 1px solid #ced4da;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus
    .select2-selection--multiple {
    border-color: #80bdff;
}

.input-group .select2-container .select2-selection--single {
    border-top-left-radius: unset;
    border-bottom-left-radius: unset;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-weight: 400;
    font-family: inherit;
    line-height: 1.5;
    color: unset;
}

.select2-container .select2-selection--single .select2-selection__clear {
    height: calc(1.5em + 0.5rem + 2px);
    width: 30px;
    padding: 0 0.25rem;
    margin-right: 30px;
    border-left: 1px solid #ced4da;
    color: #dc3545;
}

.select2-container .select2-selection--single .select2-selection__clear span {
    font-size: 1.25rem;
    line-height: 1;
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 0.5rem + 2px);
    width: 30px;
    border-left: 1px solid #ced4da;
}

.select2-container .select2-dropdown {
    padding: 0.5rem;
}

.select2-container .select2-dropdown .select2-search {
    padding: 0 0 0.5rem 0;
}

.select2-container .select2-dropdown .select2-search input {
    border-radius: 0.25rem;
}

.select2.is-invalid .select2-selection {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 2.5em center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-tags .select2.is-invalid .select2-selection {
    background-position: right 0.5em top 0.5em;
}

.select2 .selection-tags {
    height: 120px;
}

.select2 .selection-add-tags {
    height: 300px;
}

.select2 textarea[type="search"] {
    width: 200px !important;
}

.select2-container .dropdown-tags ul {
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 0;
    margin: 0.5rem;
    gap: 0.5rem !important;
}

.select2-container .dropdown-tags ul li {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background-color: #ced4da;
}

/* daterangepicker */
.daterangepicker .calendar-time {
    padding-right: 8px;
    display: flex;
    flex-direction: row;
    align-items: start;
    align-self: stretch;
    gap: 0.25rem !important;
}

.daterangepicker .calendar-time select {
    flex: 1;
    padding: 0.5rem 0.25rem;
    border-radius: 0.25rem;
}

/* 表單 */
form .required::before {
    content: "*";
    color: #dc3545;
}

form .form-group {
    margin-bottom: 0;
}

form .invalid-feedback::before {
    content: "➤ ";
}

form .form-text::before {
    content: "⊙ ";
}

form .input-group.checkbox {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6 !important;
}

form .input-group.checkbox.is-invalid {
    border-color: #dc3545 !important;
}

/* 表單: 檔案上傳 */
form .form-group.form-upload .input-upload {
    display: block;
    width: 100%;
    height: 250px;
    min-width: 250px;
    padding: 1rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: inset 0 0 0 transparent;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

form .form-group.form-upload .input-upload.is-invalid {
    border-color: #dc3545;
}

form .form-group.form-upload .input-upload .btnFileUp i {
    font-size: 5rem;
}

form .form-group.form-upload .input-upload .btnFileDel i {
    font-size: 2rem;
}

form .form-group.form-upload .input-upload .tool {
    height: 100%;
}

form .form-group.form-upload .input-upload .preview {
    height: 100%;
    font-size: 1rem;
    font-weight: bold;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

form.input-group-edit .input-group-prepend .input-group-text {
    display: inline-block;
    width: 100px;
    text-align: right;
    font-weight: bold;
    background-color: transparent;
}

form.input-group-edit .sortable .form-upload label {
    width: 100%;
    cursor: pointer;
}
