.hatc-page {
    color: #263238;
    padding: 12px;
}

.hatc-toolbar,
.hatc-filter,
.hatc-summary,
.hatc-pager {
    display: flex;
    align-items: center;
}

.hatc-toolbar {
    justify-content: flex-end;
    min-height: 36px;
}

.hatc-actions,
.hatc-row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hatc-view-switch {
    border: 1px solid #d6dbe0;
    border-radius: 4px;
    overflow: hidden;
}

.hatc-view-switch .btn {
    border: 0;
    border-radius: 0;
    min-height: 31px;
    min-width: 34px;
}

.hatc-filter {
    background: #f7f8fa;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    display: block;
    margin-top: 8px;
    padding: 10px 12px 8px;
}

.hatc-filter label,
#modal-hinh-anh-thi-cong label {
    color: #455a64;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.hatc-summary {
    color: #607d8b;
    font-size: 13px;
    gap: 18px;
    min-height: 40px;
}

.hatc-summary strong {
    color: #263238;
}

.hatc-bulk-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.hatc-loading,
.hatc-empty {
    align-items: center;
    color: #78909c;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 280px;
}

.hatc-loading .fa,
.hatc-empty .fa {
    font-size: 32px;
    margin-bottom: 10px;
}

.hatc-empty p {
    margin: 0;
}

.hatc-list {
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    overflow: hidden;
}

.hatc-list thead th {
    background: #eef1f4;
    border-bottom: 1px solid #cfd6dc;
    color: #455a64;
    font-size: 12px;
    font-weight: 600;
    padding: 9px 8px;
    vertical-align: middle;
}

.hatc-list tbody td {
    font-size: 13px;
    padding: 7px 8px;
    vertical-align: middle;
}

.hatc-description-cell {
    min-width: 240px;
}

.hatc-description-row + .hatc-description-row {
    border-top: 1px dashed #dfe3e8;
    margin-top: 6px;
    padding-top: 6px;
}

.hatc-description-label {
    color: #607d8b;
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 2px;
}

.hatc-preserve-lines {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.hatc-description-cell .hatc-preserve-lines {
    color: #263238;
    display: block;
    line-height: 1.45;
}

.hatc-description-cell > small {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.hatc-col-image {
    width: 86px;
}

.hatc-col-select {
    text-align: center;
    width: 42px;
}

.hatc-col-actions {
    width: 120px;
}

.hatc-thumb-button,
.hatc-photo-image {
    background: #eceff1;
    border: 0;
    cursor: zoom-in;
    display: block;
    overflow: hidden;
    padding: 0;
    position: relative;
}

.hatc-thumb-button {
    border-radius: 4px;
    height: 56px;
    width: 74px;
}

.hatc-thumb-button img,
.hatc-photo-image img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.hatc-cover-mark,
.hatc-photo-badge {
    align-items: center;
    background: #ffca28;
    color: #263238;
    display: flex;
    justify-content: center;
    position: absolute;
    right: 6px;
    top: 6px;
}

.hatc-cover-mark {
    border-radius: 50%;
    font-size: 9px;
    height: 20px;
    width: 20px;
}

.hatc-album {
    display: block;
}

.hatc-album-group + .hatc-album-group {
    border-top: 1px solid #dfe3e8;
    margin-top: 22px;
    padding-top: 18px;
}

.hatc-album-group-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.hatc-album-group-header h2 {
    color: #263238;
    font-size: 15px;
    font-weight: 600;
    line-height: 24px;
    margin: 0;
}

.hatc-album-group-header h2 .fa {
    color: #607d8b;
    margin-right: 6px;
}

.hatc-album-group-header > span {
    background: #eef2f5;
    border-radius: 4px;
    color: #546e7a;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
}

.hatc-album-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
}

.hatc-album-card {
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(38, 50, 56, 0.06);
    min-width: 0;
    overflow: hidden;
}

.hatc-album-card:hover {
    border-color: #aebbc4;
    box-shadow: 0 3px 10px rgba(38, 50, 56, 0.11);
}

.hatc-album-card-header {
    align-items: center;
    border-bottom: 1px solid #e6eaed;
    display: flex;
    justify-content: space-between;
    min-height: 44px;
    padding: 6px 8px 6px 12px;
}

.hatc-album-card-header > span {
    color: #455a64;
    font-size: 12px;
    font-weight: 600;
}

.hatc-album-images {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    padding: 8px;
}

.hatc-album-photo {
    aspect-ratio: 4 / 3;
    background: #e7ebee;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    display: block;
    overflow: hidden;
    padding: 0;
    position: relative;
    width: 100%;
}

.hatc-album-photo img {
    height: 100%;
    object-fit: cover;
    transition: transform 160ms ease;
    width: 100%;
}

.hatc-album-photo:hover img,
.hatc-album-photo:focus img {
    transform: scale(1.025);
}

.hatc-album-photo-index,
.hatc-album-photo-cover {
    background: rgba(20, 28, 33, 0.82);
    border-radius: 3px;
    bottom: 8px;
    color: #fff;
    font-size: 11px;
    padding: 4px 7px;
    position: absolute;
}

.hatc-album-photo-index {
    left: 8px;
}

.hatc-album-photo-cover {
    color: #ffc107;
    right: 8px;
}

.hatc-album-actions,
.hatc-manager-actions {
    display: flex;
    gap: 4px;
}

.hatc-photo {
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(38, 50, 56, 0.06);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.hatc-photo:hover {
    border-color: #b8c4cc;
    box-shadow: 0 3px 10px rgba(38, 50, 56, 0.1);
}

.hatc-photo-image {
    aspect-ratio: 4 / 3;
    width: 100%;
}

.hatc-photo-badge {
    border-radius: 4px;
    font-size: 11px;
    height: 24px;
    width: 24px;
}

.hatc-photo-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 10px;
}

.hatc-photo-heading {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.hatc-photo-title {
    font-size: 14px;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hatc-field-badge {
    background: #e8f1f8;
    border: 1px solid #ccdae5;
    border-radius: 4px;
    color: #315a78;
    font-size: 11px;
    flex: 0 1 auto;
    max-width: 48%;
    overflow: hidden;
    padding: 3px 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hatc-photo-body p {
    color: #455a64;
    display: -webkit-box;
    font-size: 12px;
    height: 36px;
    line-height: 18px;
    margin: 9px 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.hatc-photo-info {
    color: #607d8b;
    display: grid;
    font-size: 11px;
    gap: 5px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: auto;
}

.hatc-photo-info span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hatc-photo-info .fa {
    color: #90a4ae;
    margin-right: 3px;
}

.hatc-photo-footer {
    align-items: center;
    border-top: 1px solid #edf0f2;
    color: #78909c;
    display: flex;
    font-size: 11px;
    justify-content: space-between;
    padding-top: 8px;
}

.hatc-photo-footer > small {
    min-width: 0;
    overflow: hidden;
    padding-right: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hatc-row-actions .btn {
    align-items: center;
    display: inline-flex;
    height: 29px;
    justify-content: center;
    padding: 0;
    width: 29px;
}

.hatc-pager {
    flex-wrap: wrap;
    font-size: 12px;
    gap: 12px;
    justify-content: flex-end;
    padding: 12px 0 2px;
}

.hatc-pager nav {
    display: flex;
    gap: 3px;
}

.hatc-pager nav .btn {
    min-width: 31px;
}

.hatc-page-size {
    align-items: center;
    display: flex;
    gap: 6px;
}

.hatc-page-size select {
    width: 74px;
}

.hatc-upload-bar {
    align-items: center;
    border-top: 1px solid #e3e7ea;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-top: 2px;
    padding: 12px 0;
}

.hatc-editor-dialog {
    margin: 20px auto;
    max-width: 1320px !important;
    width: calc(100% - 32px);
}

#modal-hinh-anh-thi-cong .modal-body {
    max-height: calc(100vh - 172px);
    overflow-y: auto;
    padding: 20px;
}

#modal-hinh-anh-thi-cong .modal-header,
#modal-hinh-anh-thi-cong .modal-footer {
    padding-left: 20px;
    padding-right: 20px;
}

.hatc-field-select-wrap {
    min-width: 0;
    position: relative;
}

.hatc-field-select-wrap > .select2-container {
    max-width: 100%;
    width: 100% !important;
}

#modal-hinh-anh-thi-cong .select2-container--default .select2-selection--multiple {
    border-color: #ced4da;
    border-radius: 4px;
    min-height: 38px;
}

#modal-hinh-anh-thi-cong .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #80bdff;
}

.ui-datepicker {
    z-index: 1065 !important;
}

.hatc-upload-bar span {
    color: #607d8b;
    font-size: 12px;
}

.hatc-selected-files {
    border: 1px solid #dfe3e8;
    border-radius: 4px;
    max-height: 420px;
    overflow: auto;
}

.hatc-selected-files table {
    min-width: 760px;
    table-layout: fixed;
}

.hatc-selected-files thead th {
    background: #eef1f4;
    border-bottom-width: 1px;
    color: #455a64;
    font-size: 12px;
    font-weight: 600;
    padding: 8px;
    position: sticky;
    top: 0;
    vertical-align: middle;
    z-index: 1;
}

.hatc-selected-files tbody td {
    padding: 8px;
    vertical-align: middle;
}

.hatc-selected-order {
    text-align: center;
    width: 52px;
}

.hatc-selected-drag-col {
    text-align: center;
    width: 44px;
}

.hatc-drag-handle {
    background: transparent;
    border: 0;
    color: #607d8b;
    cursor: grab;
    height: 32px;
    padding: 0;
    width: 32px;
}

.hatc-drag-handle:active {
    cursor: grabbing;
}

.hatc-drag-handle.dragging {
    background: #dcecff;
    box-shadow: 0 4px 12px rgba(38, 50, 56, 0.24);
    color: #006dcc;
    cursor: grabbing;
    opacity: 0.92;
}

.hatc-selected-files tbody tr.drag-enter > td {
    background: #e8f2ff;
    border-top: 2px solid #1683e5;
}

.hatc-selected-image-col {
    width: 128px;
}

.hatc-selected-name-col {
    width: 260px;
}

.hatc-selected-action-col {
    text-align: center;
    width: 48px;
}

.hatc-selected-cover-col {
    text-align: center;
    width: 72px;
}

.hatc-selected-preview {
    background: #eceff1;
    border: 0;
    border-radius: 4px;
    display: block;
    height: 76px;
    overflow: hidden;
    padding: 0;
    width: 110px;
}

.hatc-selected-preview img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.hatc-selected-info {
    min-width: 0;
}

.hatc-selected-info strong {
    display: block;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hatc-selected-info small {
    color: #78909c;
    display: block;
    margin-top: 5px;
}

.hatc-selected-files textarea {
    min-height: 76px;
    resize: vertical;
}

.hatc-existing-album .hatc-selected-files table {
    min-width: 900px;
}

.hatc-edit-selection {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hatc-row-removed td {
    background: #fff4f4;
    color: #8a9297;
}

.hatc-row-removed .hatc-selected-preview,
.hatc-row-removed .hatc-selected-info {
    opacity: 0.48;
}

.hatc-preview-modal .modal-body {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) 280px;
}

.hatc-preview-modal .modal-body > img {
    background: #15191c;
    height: min(68vh, 720px);
    object-fit: contain;
    width: 100%;
}

.hatc-preview-modal dl {
    font-size: 13px;
    margin: 0;
}

.hatc-preview-modal dt {
    color: #607d8b;
    font-size: 11px;
    text-transform: uppercase;
}

.hatc-preview-modal dd {
    border-bottom: 1px solid #edf0f2;
    margin: 3px 0 12px;
    overflow-wrap: anywhere;
    padding-bottom: 8px;
}

.hatc-manager-dialog {
    margin: 12px auto;
    max-width: 1240px !important;
    width: calc(100% - 24px);
}

.hatc-manager-modal .modal-body {
    background: #f3f5f6;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 12px;
}

.hatc-gallery-loading {
    align-items: center;
    color: #607d8b;
    display: flex;
    font-size: 30px;
    justify-content: center;
    min-height: 440px;
}

.hatc-manager-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.hatc-manager-item {
    background: #fff;
    border: 1px solid #d7dde2;
    border-radius: 6px;
    min-width: 0;
    position: relative;
}

.hatc-manager-item.selected {
    border-color: #dc3545;
    box-shadow: 0 0 0 1px #dc3545;
}

.hatc-manager-image {
    aspect-ratio: 4 / 3;
    background: #e4e8eb;
    border: 0;
    border-radius: 6px 6px 0 0;
    display: block;
    overflow: hidden;
    padding: 0;
    position: relative;
    width: 100%;
}

.hatc-manager-image img {
    height: 100%;
    object-fit: cover;
    transition: transform 160ms ease;
    width: 100%;
}

.hatc-manager-image:hover img,
.hatc-manager-image:focus img {
    transform: scale(1.025);
}

.hatc-manager-index,
.hatc-manager-cover {
    background: rgba(17, 23, 26, 0.78);
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    padding: 4px 7px;
    position: absolute;
    top: 7px;
}

.hatc-manager-index {
    left: 7px;
}

.hatc-manager-cover {
    color: #ffc107;
    right: 7px;
}

.hatc-manager-check {
    align-items: center;
    background: #fff;
    border: 1px solid #ccd3d9;
    border-radius: 4px;
    display: flex;
    height: 28px;
    justify-content: center;
    left: 7px;
    margin: 0;
    position: absolute;
    top: 42px;
    width: 28px;
}

.hatc-manager-item-footer {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: space-between;
    min-height: 44px;
    padding: 6px 7px 6px 9px;
}

.hatc-manager-item-footer > span {
    color: #455a64;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hatc-manager-empty {
    align-items: center;
    color: #78909c;
    display: flex;
    justify-content: center;
    min-height: 220px;
}

.hatc-gallery-selection {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-right: auto;
}

.lg-backdrop,
.lg-outer {
    z-index: 1100 !important;
}

.lg-sub-html .hatc-lg-caption {
    margin: 0 auto;
    max-width: 980px;
    text-align: left;
}

.lg-sub-html .hatc-lg-caption h4 {
    font-size: 15px;
    margin: 0 0 6px;
    overflow-wrap: anywhere;
}

.lg-sub-html .hatc-lg-description {
    align-items: flex-start;
    display: grid;
    gap: 8px;
    grid-template-columns: 92px minmax(0, 1fr);
    margin: 4px 0;
}

.lg-sub-html .hatc-lg-description > strong {
    font-size: 12px;
}

.lg-sub-html .hatc-lg-description .hatc-preserve-lines {
    font-size: 13px;
    line-height: 1.45;
}

.lg-sub-html .hatc-lg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
}

.lg-sub-html .hatc-lg-meta span {
    font-size: 12px;
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .hatc-page {
        padding: 8px;
    }

    .hatc-actions {
        flex-wrap: wrap;
        width: 100%;
    }

    .hatc-actions > .btn-primary {
        margin-left: auto;
    }

    .hatc-album-images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hatc-photo-info {
        grid-template-columns: 1fr;
    }

    .hatc-manager-dialog {
        margin: 6px auto;
        width: calc(100% - 12px);
    }

    .hatc-manager-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hatc-manager-modal .modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .hatc-gallery-selection {
        justify-content: space-between;
        margin-right: 0;
    }

    .hatc-editor-dialog {
        margin: 8px auto;
        width: calc(100% - 16px);
    }

    #modal-hinh-anh-thi-cong .modal-body {
        max-height: calc(100vh - 140px);
        padding: 14px;
    }

    .hatc-preview-modal .modal-body {
        grid-template-columns: 1fr;
    }

    .hatc-preview-modal .modal-body > img {
        height: 50vh;
    }

    .hatc-pager {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .hatc-album-images,
    .hatc-manager-grid {
        grid-template-columns: 1fr;
    }

}
