/* ==========================================================================
   PHONG CÁCH TỔNG THỂ & ĐIỀU CHỈNH KÍCH THƯỚC CHỮ TOÀN APP (NÂNG TẦNG GIAO DIỆN)
   ========================================================================== */
:root {
    --apple-font-size-base: 15px; /* Tăng kích thước chữ nền tảng từ 13px lên 15px */
    --apple-font-size-small: 14px;
    --apple-font-size-title: 20px;
}

.finder-container {
    width: 100%;
    font-size: var(--apple-font-size-base);
}

/* ==========================================================================
   THIẾT KẾ THANH TÌM KIẾM CHUẨN TRẢI NGHIỆM iMAC / macOS (SUPER CLEAN)
   ========================================================================== */
.mac-search-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
    width: 100%;
}

.search-input-container {
    position: relative;
    width: 100%;
    max-width: 520px; /* Độ rộng vừa vặn, sang trọng */
    display: flex;
    align-items: center;
}

/* Ô input thiết kế mềm mại, có bóng đổ mịn màng chuẩn Apple */
.search-input-container input[type="text"] {
    width: 100%;
    padding: 11px 16px 11px 42px; /* Dành chỗ cho icon kính lúp phía trước */
    font-size: var(--apple-font-size-base);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1d1d1f;
    background-color: rgba(0, 0, 0, 0.03); /* Nền mờ nhẹ */
    border: 1px solid transparent;
    border-radius: 12px; /* Bo cong nhiều hơn kiểu macOS */
    outline: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

/* Hiệu ứng Focus phát sáng xanh nhẹ khi click vào ô tìm kiếm */
.search-input-container input[type="text"]:focus {
    background-color: #ffffff;
    border-color: #0071e3;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15), 0 4px 12px rgba(0,0,0,0.04);
}

/* Định vị lại kính lúp */
.search-input-container .search-icon {
    position: absolute;
    left: 15px;
    color: #86868b;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.search-input-container input[type="text"]:focus + .search-icon {
    color: #0071e3; /* Kính lúp đổi màu xanh khi gõ */
}

/* ==========================================================================
   HỆ THỐNG LƯỚI 3 CỘT RESPONSIVE (ĐÃ FIX CO GIÃN)
   ========================================================================== */
.admin-grid-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px; /* Tăng khoảng cách giữa các card để nhìn thoáng đãng */
    width: 100%;
    box-sizing: border-box;
    padding: 10px 0;
}

/* Tự động chuyển 2 cột trên máy tính bảng */
@media (max-width: 1100px) {
    .admin-grid-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

/* Tự động chuyển 1 cột trên điện thoại */
@media (max-width: 768px) {
    .admin-grid-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* CARD THIẾT KẾ LƯU TRỮ */
.qr-cloud-card {
    background: white;
    border: 1px solid #e5e5ea;
    border-radius: 14px;
    padding: 20px; /* Tăng padding tổng thể */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0,0,0,0.015);
    position: relative;
    box-sizing: border-box;
    height: auto !important;
    min-height: 300px; /* Tăng nhẹ chiều cao để chứa chữ lớn hơn */
    transition: all 0.25s ease;
}

.qr-cloud-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.05);
    border-color: rgba(0, 113, 227, 0.2);
}

/* ==========================================================================
   HÀNG NÚT BẤM HÀNH ĐỘNG DƯỚI ĐÁY (ĐÃ FIX TRIỆT ĐỂ LỖI TRÀN CHỮ)
   ========================================================================== */
.qr-action-row-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f2f2f7;
    padding-top: 14px;
    width: 100%;
    gap: 2px; /* Giảm gap tối thiểu để dồn hàng ngang */
}

/* Kiểu dáng nút bấm thon gọn, tự co giãn chữ theo khung */
.qr-action-row-container .btn-action {
    background: none;
    border: 1px solid transparent;
    font-size: 12px; /* Chữ hiển thị nút thon gọn */
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px; /* Tối ưu padding vừa vặn */
    border-radius: 6px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    white-space: nowrap; /* Tránh tự động xuống dòng bẻ đôi chữ */
    flex: 1; /* Chia đều không gian bề ngang cho các nút download */
    min-width: 0; /* Cho phép nút thu nhỏ tối đa không bị vỡ */
}

/* Tỷ lệ đặc biệt cho nút Sửa và Xóa ở hai đầu */
.qr-action-row-container .btn-edit,
.qr-action-row-container .btn-delete {
    flex: 1.1; /* Nhỉnh hơn một chút để chứa đủ chữ */
}

/* Phối màu nút */
.qr-action-row-container .btn-edit {
    color: #0071e3;
}
.qr-action-row-container .btn-edit:hover {
    background-color: rgba(0, 113, 227, 0.08);
}

.qr-action-row-container .btn-download-png,
.qr-action-row-container .btn-download-svg,
.qr-action-row-container .btn-download-4k {
    color: #515154;
}
.qr-action-row-container .btn-download-png:hover,
.qr-action-row-container .btn-download-svg:hover,
.qr-action-row-container .btn-download-4k:hover {
    background-color: #f5f5f7;
    color: #1d1d1f;
}

.qr-action-row-container .btn-delete {
    color: #ff3b30;
}
.qr-action-row-container .btn-delete:hover {
    background-color: rgba(255, 59, 48, 0.08);
}
.qr-cloud-card img {
    max-width: 100%;
    height: auto;
    object-fit: contain; /* Quan trọng: Giữ tỷ lệ ảnh */
}

/* Giới hạn khung chứa ảnh QR */
.qr-card-preview {
    width: 100% !important;
    max-width: 200px;
    margin: 0 auto !important;
    overflow: hidden;
}